/[svn]/gigedit/trunk/src/gigedit/mainwindow.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/mainwindow.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3749 by schoenebeck, Sun Feb 16 18:39:53 2020 UTC revision 3800 by schoenebeck, Sun Jul 26 13:27:16 2020 UTC
# Line 3757  void MainWindow::onScriptSlotsModified(g Line 3757  void MainWindow::onScriptSlotsModified(g
3757    
3758      // causes the sampler to reload the instrument with the new script      // causes the sampler to reload the instrument with the new script
3759      on_sel_change();      on_sel_change();
3760    
3761        // force script 'patch' variables editor ("Script" tab) to be refreshed
3762        dimreg_edit.scriptVars.setInstrument(pInstrument, true/*force update*/);
3763  }  }
3764    
3765  void MainWindow::assignScript(gig::Script* pScript) {  void MainWindow::assignScript(gig::Script* pScript) {
# Line 4372  void MainWindow::add_instrument(gig::Ins Line 4375  void MainWindow::add_instrument(gig::Ins
4375      Gtk::TreeModel::iterator iterInstr = m_refTreeModel->append();      Gtk::TreeModel::iterator iterInstr = m_refTreeModel->append();
4376      Gtk::TreeModel::Row rowInstr = *iterInstr;      Gtk::TreeModel::Row rowInstr = *iterInstr;
4377      const int index = m_refTreeModel->children().size() - 1;      const int index = m_refTreeModel->children().size() - 1;
4378        const int iScriptSlots = instrument->ScriptSlotCount();
4379      rowInstr[m_Columns.m_col_nr] = index;      rowInstr[m_Columns.m_col_nr] = index;
4380      rowInstr[m_Columns.m_col_name] = name;      rowInstr[m_Columns.m_col_name] = name;
4381      rowInstr[m_Columns.m_col_instr] = instrument;      rowInstr[m_Columns.m_col_instr] = instrument;
4382      rowInstr[m_Columns.m_col_scripts] = "";      rowInstr[m_Columns.m_col_scripts] = iScriptSlots ? ToString(iScriptSlots) : "";
4383      rowInstr[m_Columns.m_col_tooltip] = scriptTooltipFor(instrument, index);      rowInstr[m_Columns.m_col_tooltip] = scriptTooltipFor(instrument, index);
4384      instrument_name_connection.unblock();      instrument_name_connection.unblock();
4385    
# Line 4567  void MainWindow::editScript(gig::Script* Line 4571  void MainWindow::editScript(gig::Script*
4571      editor->signal_script_to_be_changed.connect(      editor->signal_script_to_be_changed.connect(
4572          signal_script_to_be_changed.make_slot()          signal_script_to_be_changed.make_slot()
4573      );      );
4574      editor->signal_script_changed.connect(      editor->signal_script_changed.connect([this](gig::Script* script) {
4575          signal_script_changed.make_slot()          // signal to sampler (which will reload the script due to this)
4576      );          signal_script_changed.emit(script);
4577            // force script 'patch' variables editor ("Script" tab) to be refreshed
4578            gig::Instrument* instr = get_instrument();
4579            dimreg_edit.scriptVars.setInstrument(instr, true/*force update*/);
4580        });
4581      editor->setScript(script);      editor->setScript(script);
4582      //editor->reparent(*this);      //editor->reparent(*this);
4583      editor->show();      editor->show();
# Line 5333  void MainWindow::script_double_clicked(c Line 5341  void MainWindow::script_double_clicked(c
5341      if (!iter) return;      if (!iter) return;
5342      Gtk::TreeModel::Row row = *iter;      Gtk::TreeModel::Row row = *iter;
5343      gig::Script* script = row[m_ScriptsModel.m_col_script];      gig::Script* script = row[m_ScriptsModel.m_col_script];
5344      if (!script) return;      editScript(script);
   
     ScriptEditor* editor = new ScriptEditor;  
     editor->signal_script_to_be_changed.connect(  
         signal_script_to_be_changed.make_slot()  
     );  
     editor->signal_script_changed.connect(  
         signal_script_changed.make_slot()  
     );  
     editor->setScript(script);  
     //editor->reparent(*this);  
     editor->show();  
5345  }  }
5346    
5347  void MainWindow::instrument_name_changed(const Gtk::TreeModel::Path& path,  void MainWindow::instrument_name_changed(const Gtk::TreeModel::Path& path,

Legend:
Removed from v.3749  
changed lines
  Added in v.3800

  ViewVC Help
Powered by ViewVC