/[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 3450 by schoenebeck, Wed Jan 2 16:39:20 2019 UTC revision 3472 by persson, Sat Feb 16 19:56:56 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (C) 2006-2017 Andreas Persson   * Copyright (C) 2006-2019 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 21  Line 21 
21  #include <cstring>  #include <cstring>
22    
23  #include "compat.h"  #include "compat.h"
 // threads.h must be included first to be able to build with  
 // G_DISABLE_DEPRECATED  
 #if (GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION == 31 && GLIBMM_MICRO_VERSION >= 2) || \  
     (GLIBMM_MAJOR_VERSION == 2 && GLIBMM_MINOR_VERSION > 31) || GLIBMM_MAJOR_VERSION > 2  
 #include <glibmm/threads.h>  
 #endif  
24    
25  #include <glibmm/convert.h>  #include <glibmm/convert.h>
26  #include <glibmm/dispatcher.h>  #include <glibmm/dispatcher.h>
# Line 1516  MainWindow::MainWindow() : Line 1510  MainWindow::MainWindow() :
1510          sigc::hide(          sigc::hide(
1511              sigc::bind(              sigc::bind(
1512                  file_structure_to_be_changed_signal.make_slot(),                  file_structure_to_be_changed_signal.make_slot(),
1513    #if SIGCXX_MAJOR_VERSION > 2 || (SIGCXX_MAJOR_VERSION == 2 && SIGCXX_MINOR_VERSION >= 8)
1514                    std::ref(this->file)
1515    #else
1516                  sigc::ref(this->file)                  sigc::ref(this->file)
1517    #endif
1518              )              )
1519          )          )
1520      );      );
# Line 1524  MainWindow::MainWindow() : Line 1522  MainWindow::MainWindow() :
1522          sigc::hide(          sigc::hide(
1523              sigc::bind(              sigc::bind(
1524                  file_structure_changed_signal.make_slot(),                  file_structure_changed_signal.make_slot(),
1525    #if SIGCXX_MAJOR_VERSION > 2 || (SIGCXX_MAJOR_VERSION == 2 && SIGCXX_MINOR_VERSION >= 8)
1526                    std::ref(this->file)
1527    #else
1528                  sigc::ref(this->file)                  sigc::ref(this->file)
1529    #endif
1530              )              )
1531          )          )
1532      );      );
# Line 1546  MainWindow::MainWindow() : Line 1548  MainWindow::MainWindow() :
1548          sigc::mem_fun(*this, &MainWindow::update_dimregs));          sigc::mem_fun(*this, &MainWindow::update_dimregs));
1549    
1550      m_searchText.signal_changed().connect(      m_searchText.signal_changed().connect(
1551          sigc::mem_fun(m_refTreeModelFilter.operator->(), &Gtk::TreeModelFilter::refilter)          sigc::mem_fun(*m_refTreeModelFilter.operator->(), &Gtk::TreeModelFilter::refilter)
1552      );      );
1553    
1554      file = 0;      file = 0;
# Line 1884  void MainWindow::on_sel_change() Line 1886  void MainWindow::on_sel_change()
1886      }      }
1887  }  }
1888    
1889    
1890    LoaderSaverBase::LoaderSaverBase(const Glib::ustring filename, gig::File* gig) :
1891        filename(filename), gig(gig),
1892    #ifdef GLIB_THREADS
1893        thread(0),
1894    #endif
1895        progress(0.f)
1896    {
1897    }
1898    
1899  void loader_progress_callback(gig::progress_t* progress)  void loader_progress_callback(gig::progress_t* progress)
1900  {  {
1901      Loader* loader = static_cast<Loader*>(progress->custom);      LoaderSaverBase* loader = static_cast<LoaderSaverBase*>(progress->custom);
1902      loader->progress_callback(progress->factor);      loader->progress_callback(progress->factor);
1903  }  }
1904    
1905  void Loader::progress_callback(float fraction)  void LoaderSaverBase::progress_callback(float fraction)
1906  {  {
1907      {      {
1908    #ifdef GLIB_THREADS
1909          Glib::Threads::Mutex::Lock lock(progressMutex);          Glib::Threads::Mutex::Lock lock(progressMutex);
1910    #else
1911            std::lock_guard<std::mutex> lock(progressMutex);
1912    #endif
1913          progress = fraction;          progress = fraction;
1914      }      }
1915      progress_dispatcher();      progress_dispatcher();
# Line 1903  void Loader::progress_callback(float fra Line 1919  void Loader::progress_callback(float fra
1919  // make sure stack is 16-byte aligned for SSE instructions  // make sure stack is 16-byte aligned for SSE instructions
1920  __attribute__((force_align_arg_pointer))  __attribute__((force_align_arg_pointer))
1921  #endif  #endif
1922  void Loader::thread_function()  void LoaderSaverBase::thread_function()
1923  {  {
1924    #ifdef GLIB_THREADS
1925      printf("thread_function self=%p\n",      printf("thread_function self=%p\n",
1926             static_cast<void*>(Glib::Threads::Thread::self()));             static_cast<void*>(Glib::Threads::Thread::self()));
1927    #else
1928        std::cout << "thread_function self=" << std::this_thread::get_id() << "\n";
1929    #endif
1930      printf("Start %s\n", filename.c_str());      printf("Start %s\n", filename.c_str());
1931      try {      try {
         RIFF::File* riff = new RIFF::File(filename);  
         gig = new gig::File(riff);  
1932          gig::progress_t progress;          gig::progress_t progress;
1933          progress.callback = loader_progress_callback;          progress.callback = loader_progress_callback;
1934          progress.custom = this;          progress.custom = this;
1935    
1936          gig->GetInstrument(0, &progress);          thread_function_sub(progress);
1937          printf("End\n");          printf("End\n");
1938          finished_dispatcher();          finished_dispatcher();
1939      } catch (RIFF::Exception e) {      } catch (RIFF::Exception e) {
# Line 1927  void Loader::thread_function() Line 1945  void Loader::thread_function()
1945      }      }
1946  }  }
1947    
1948  Loader::Loader(const char* filename)  void LoaderSaverBase::launch()
     : filename(filename), gig(0), thread(0), progress(0.f)  
 {  
 }  
   
 void Loader::launch()  
1949  {  {
1950    #ifdef GLIB_THREADS
1951  #ifdef OLD_THREADS  #ifdef OLD_THREADS
1952      thread = Glib::Thread::create(sigc::mem_fun(*this, &Loader::thread_function), true);      thread = Glib::Thread::create(sigc::mem_fun(*this, &LoaderSaverBase::thread_function), true);
1953  #else  #else
1954      thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &Loader::thread_function));      thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &LoaderSaverBase::thread_function));
1955  #endif  #endif
1956      printf("launch thread=%p\n", static_cast<void*>(thread));      printf("launch thread=%p\n", static_cast<void*>(thread));
1957    #else
1958        thread = std::thread([this](){ thread_function(); });
1959        std::cout << "launch thread=" << thread.get_id() << "\n";
1960    #endif
1961  }  }
1962    
1963  float Loader::get_progress()  float LoaderSaverBase::get_progress()
1964  {  {
1965      float res;  #ifdef GLIB_THREADS
1966      {      Glib::Threads::Mutex::Lock lock(progressMutex);
1967          Glib::Threads::Mutex::Lock lock(progressMutex);  #else
1968          res = progress;      std::lock_guard<std::mutex> lock(progressMutex);
1969      }  #endif
1970      return res;      return progress;
1971  }  }
1972    
1973  Glib::Dispatcher& Loader::signal_progress()  Glib::Dispatcher& LoaderSaverBase::signal_progress()
1974  {  {
1975      return progress_dispatcher;      return progress_dispatcher;
1976  }  }
1977    
1978  Glib::Dispatcher& Loader::signal_finished()  Glib::Dispatcher& LoaderSaverBase::signal_finished()
1979  {  {
1980      return finished_dispatcher;      return finished_dispatcher;
1981  }  }
1982    
1983  Glib::Dispatcher& Loader::signal_error()  Glib::Dispatcher& LoaderSaverBase::signal_error()
1984  {  {
1985      return error_dispatcher;      return error_dispatcher;
1986  }  }
1987    
1988  void saver_progress_callback(gig::progress_t* progress)  void LoaderSaverBase::join() {
1989  {  #ifdef GLIB_THREADS
1990      Saver* saver = static_cast<Saver*>(progress->custom);      thread->join();
1991      saver->progress_callback(progress->factor);  #else
1992        thread.join();
1993    #endif
1994  }  }
1995    
1996  void Saver::progress_callback(float fraction)  
1997    Loader::Loader(const char* filename) :
1998        LoaderSaverBase(filename, 0)
1999  {  {
     {  
         Glib::Threads::Mutex::Lock lock(progressMutex);  
         progress = fraction;  
     }  
     progress_dispatcher.emit();  
2000  }  }
2001    
2002  #if defined(WIN32) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))  void Loader::thread_function_sub(gig::progress_t& progress)
 // make sure stack is 16-byte aligned for SSE instructions  
 __attribute__((force_align_arg_pointer))  
 #endif  
 void Saver::thread_function()  
2003  {  {
2004      printf("thread_function self=%p\n",      RIFF::File* riff = new RIFF::File(filename);
2005             static_cast<void*>(Glib::Threads::Thread::self()));      gig = new gig::File(riff);
     printf("Start %s\n", filename.c_str());  
     try {  
         gig::progress_t progress;  
         progress.callback = saver_progress_callback;  
         progress.custom = this;  
2006    
2007          // if no filename was provided, that means "save", if filename was provided means "save as"      gig->GetInstrument(0, &progress);
         if (filename.empty()) {  
             if (!Settings::singleton()->saveWithTemporaryFile) {  
                 // save directly over the existing .gig file  
                 // (requires less disk space than solution below  
                 // but may be slower)  
                 gig->Save(&progress);  
             } else {  
                 // save the file as separate temporary file first,  
                 // then move the saved file over the old file  
                 // (may result in performance speedup during save)  
                 gig::String tmpname = filename + ".TMP";  
                 gig->Save(tmpname, &progress);  
                 #if defined(WIN32)  
                 if (!DeleteFile(filename.c_str())) {  
                     throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file).");  
                 }  
                 #else // POSIX ...  
                 if (unlink(filename.c_str())) {  
                     throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + gig::String(strerror(errno)));  
                 }  
                 #endif  
                 if (rename(tmpname.c_str(), filename.c_str())) {  
                     #if defined(WIN32)  
                     throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file).");  
                     #else  
                     throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + gig::String(strerror(errno)));  
                     #endif  
                 }  
             }  
         } else {  
             gig->Save(filename, &progress);  
         }  
   
         printf("End\n");  
         finished_dispatcher.emit();  
     } catch (RIFF::Exception e) {  
         error_message = e.Message;  
         error_dispatcher.emit();  
     } catch (...) {  
         error_message = _("Unknown exception occurred");  
         error_dispatcher.emit();  
     }  
2008  }  }
2009    
2010  Saver::Saver(gig::File* file, Glib::ustring filename)  
2011      : gig(file), filename(filename), thread(0), progress(0.f)  Saver::Saver(gig::File* file, Glib::ustring filename) :
2012        LoaderSaverBase(filename, file)
2013  {  {
2014  }  }
2015    
2016  void Saver::launch()  void Saver::thread_function_sub(gig::progress_t& progress)
2017  {  {
2018  #ifdef OLD_THREADS      // if no filename was provided, that means "save", if filename was provided means "save as"
2019      thread = Glib::Thread::create(sigc::mem_fun(*this, &Saver::thread_function), true);      if (filename.empty()) {
2020            if (!Settings::singleton()->saveWithTemporaryFile) {
2021                // save directly over the existing .gig file
2022                // (requires less disk space than solution below
2023                // but may be slower)
2024                gig->Save(&progress);
2025            } else {
2026                // save the file as separate temporary file first,
2027                // then move the saved file over the old file
2028                // (may result in performance speedup during save)
2029                gig::String tmpname = filename + ".TMP";
2030                gig->Save(tmpname, &progress);
2031    #if defined(WIN32)
2032                if (!DeleteFile(filename.c_str())) {
2033                    throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file).");
2034                }
2035    #else // POSIX ...
2036                if (unlink(filename.c_str())) {
2037                    throw RIFF::Exception("Could not replace original file with temporary file (unable to remove original file): " + gig::String(strerror(errno)));
2038                }
2039    #endif
2040                if (rename(tmpname.c_str(), filename.c_str())) {
2041    #if defined(WIN32)
2042                    throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file).");
2043  #else  #else
2044      thread = Glib::Threads::Thread::create(sigc::mem_fun(*this, &Saver::thread_function));                  throw RIFF::Exception("Could not replace original file with temporary file (unable to rename temp file): " + gig::String(strerror(errno)));
2045  #endif  #endif
2046      printf("launch thread=%p\n", static_cast<void*>(thread));              }
2047  }          }
2048        } else {
2049  float Saver::get_progress()          gig->Save(filename, &progress);
 {  
     float res;  
     {  
         Glib::Threads::Mutex::Lock lock(progressMutex);  
         res = progress;  
2050      }      }
     return res;  
2051  }  }
2052    
 Glib::Dispatcher& Saver::signal_progress()  
 {  
     return progress_dispatcher;  
 }  
   
 Glib::Dispatcher& Saver::signal_finished()  
 {  
     return finished_dispatcher;  
 }  
   
 Glib::Dispatcher& Saver::signal_error()  
 {  
     return error_dispatcher;  
 }  
2053    
2054  ProgressDialog::ProgressDialog(const Glib::ustring& title, Gtk::Window& parent)  ProgressDialog::ProgressDialog(const Glib::ustring& title, Gtk::Window& parent)
2055      : Gtk::Dialog(title, parent, true)      : Gtk::Dialog(title, parent, true)
# Line 2237  void MainWindow::on_action_file_open() Line 2207  void MainWindow::on_action_file_open()
2207      if (dialog.run() == Gtk::RESPONSE_OK) {      if (dialog.run() == Gtk::RESPONSE_OK) {
2208          std::string filename = dialog.get_filename();          std::string filename = dialog.get_filename();
2209          printf("filename=%s\n", filename.c_str());          printf("filename=%s\n", filename.c_str());
2210    #ifdef GLIB_THREADS
2211          printf("on_action_file_open self=%p\n",          printf("on_action_file_open self=%p\n",
2212                 static_cast<void*>(Glib::Threads::Thread::self()));                 static_cast<void*>(Glib::Threads::Thread::self()));
2213    #else
2214            std::cout << "on_action_file_open self=" <<
2215                std::this_thread::get_id() << "\n";
2216    #endif
2217          load_file(filename.c_str());          load_file(filename.c_str());
2218          current_gig_dir = Glib::path_get_dirname(filename);          current_gig_dir = Glib::path_get_dirname(filename);
2219      }      }
# Line 2311  void MainWindow::on_loader_progress() Line 2286  void MainWindow::on_loader_progress()
2286    
2287  void MainWindow::on_loader_finished()  void MainWindow::on_loader_finished()
2288  {  {
2289        loader->join();
2290      printf("Loader finished!\n");      printf("Loader finished!\n");
2291    #ifdef GLIB_THREADS
2292      printf("on_loader_finished self=%p\n",      printf("on_loader_finished self=%p\n",
2293             static_cast<void*>(Glib::Threads::Thread::self()));             static_cast<void*>(Glib::Threads::Thread::self()));
2294    #else
2295        std::cout << "on_loader_finished self=" <<
2296            std::this_thread::get_id() << "\n";
2297    #endif
2298      load_gig(loader->gig, loader->filename.c_str());      load_gig(loader->gig, loader->filename.c_str());
2299      progress_dialog->hide();      progress_dialog->hide();
2300  }  }
2301    
2302  void MainWindow::on_loader_error()  void MainWindow::on_loader_error()
2303  {  {
2304        loader->join();
2305      Glib::ustring txt = _("Could not load file: ") + loader->error_message;      Glib::ustring txt = _("Could not load file: ") + loader->error_message;
2306      Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);      Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
2307      msg.run();      msg.run();
# Line 2390  void MainWindow::on_saver_progress() Line 2372  void MainWindow::on_saver_progress()
2372    
2373  void MainWindow::on_saver_error()  void MainWindow::on_saver_error()
2374  {  {
2375        saver->join();
2376      file_structure_changed_signal.emit(this->file);      file_structure_changed_signal.emit(this->file);
2377      Glib::ustring txt = _("Could not save file: ") + saver->error_message;      Glib::ustring txt = _("Could not save file: ") + saver->error_message;
2378      Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);      Gtk::MessageDialog msg(*this, txt, false, Gtk::MESSAGE_ERROR);
# Line 2398  void MainWindow::on_saver_error() Line 2381  void MainWindow::on_saver_error()
2381    
2382  void MainWindow::on_saver_finished()  void MainWindow::on_saver_finished()
2383  {  {
2384        saver->join();
2385      this->file = saver->gig;      this->file = saver->gig;
2386      this->filename = saver->filename;      this->filename = saver->filename;
2387      current_gig_dir = Glib::path_get_dirname(filename);      current_gig_dir = Glib::path_get_dirname(filename);
# Line 2669  void MainWindow::on_action_help_about() Line 2653  void MainWindow::on_action_help_about()
2653      dialog.set_name("Gigedit");      dialog.set_name("Gigedit");
2654  #endif  #endif
2655      dialog.set_version(VERSION);      dialog.set_version(VERSION);
2656      dialog.set_copyright("Copyright (C) 2006-2017 Andreas Persson");      dialog.set_copyright("Copyright (C) 2006-2019 Andreas Persson");
2657      const std::string sComment =      const std::string sComment =
2658          _("Built " __DATE__ "\nUsing ") +          _("Built " __DATE__ "\nUsing ") +
2659          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +          ::gig::libraryName() + " " + ::gig::libraryVersion() + "\n\n" +
# Line 2723  PropDialog::PropDialog() Line 2707  PropDialog::PropDialog()
2707      set_title(_("File Properties"));      set_title(_("File Properties"));
2708      eName.set_width_chars(50);      eName.set_width_chars(50);
2709    
2710        connect(eFileFormat, &PropDialog::set_FileFormat);
2711      connect(eName, &DLS::Info::Name);      connect(eName, &DLS::Info::Name);
2712      connect(eCreationDate, &DLS::Info::CreationDate);      connect(eCreationDate, &DLS::Info::CreationDate);
2713      connect(eComments, &DLS::Info::Comments);      connect(eComments, &DLS::Info::Comments);
# Line 2784  PropDialog::PropDialog() Line 2769  PropDialog::PropDialog()
2769      quitButton.grab_focus();      quitButton.grab_focus();
2770      quitButton.signal_clicked().connect(      quitButton.signal_clicked().connect(
2771          sigc::mem_fun(*this, &PropDialog::hide));          sigc::mem_fun(*this, &PropDialog::hide));
     eFileFormat.signal_value_changed().connect(  
         sigc::mem_fun(*this, &PropDialog::onFileFormatChanged));  
2772    
2773      quitButton.show();      quitButton.show();
2774      vbox.show();      vbox.show();
# Line 2797  PropDialog::PropDialog() Line 2780  PropDialog::PropDialog()
2780  void PropDialog::set_file(gig::File* file)  void PropDialog::set_file(gig::File* file)
2781  {  {
2782      m_file = file;      m_file = file;
2783        update(file->pInfo);
2784    
2785      // update file format version combo box      // update file format version combo box
2786      const std::string sGiga = "Gigasampler/GigaStudio v";      const std::string sGiga = "Gigasampler/GigaStudio v";
# Line 2812  void PropDialog::set_file(gig::File* fil Line 2796  void PropDialog::set_file(gig::File* fil
2796      std::vector<const char*> texts;      std::vector<const char*> texts;
2797      for (int i = 0; i < txts.size(); ++i) texts.push_back(txts[i].c_str());      for (int i = 0; i < txts.size(); ++i) texts.push_back(txts[i].c_str());
2798      texts.push_back(NULL); values.push_back(0);      texts.push_back(NULL); values.push_back(0);
2799    
2800        update_model++;
2801      eFileFormat.set_choices(&texts[0], &values[0]);      eFileFormat.set_choices(&texts[0], &values[0]);
2802      eFileFormat.set_value(major);      eFileFormat.set_value(major);
2803        update_model--;
2804  }  }
2805    
2806  void PropDialog::onFileFormatChanged() {  void PropDialog::set_FileFormat(int value)
     const int major = eFileFormat.get_value();  
     if (m_file) m_file->pVersion->major = major;  
 }  
   
 void PropDialog::set_info(DLS::Info* info)  
2807  {  {
2808      update(info);      m_file->pVersion->major = value;
2809  }  }
2810    
2811    
# Line 2998  void MainWindow::updateSampleRefCountMap Line 2980  void MainWindow::updateSampleRefCountMap
2980    
2981  bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {  bool MainWindow::onQueryTreeViewTooltip(int x, int y, bool keyboardTip, const Glib::RefPtr<Gtk::Tooltip>& tooltip) {
2982      Gtk::TreeModel::iterator iter;      Gtk::TreeModel::iterator iter;
2983      m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter);      if (!m_TreeView.get_tooltip_context_iter(x, y, keyboardTip, iter)) {
2984            return false;
2985        }
2986      Gtk::TreeModel::Path path(iter);      Gtk::TreeModel::Path path(iter);
2987      Gtk::TreeModel::Row row = *iter;      Gtk::TreeModel::Row row = *iter;
2988      Gtk::TreeViewColumn* pointedColumn = NULL;      Gtk::TreeViewColumn* pointedColumn = NULL;
# Line 3030  bool MainWindow::onQueryTreeViewTooltip( Line 3014  bool MainWindow::onQueryTreeViewTooltip(
3014  static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) {  static Glib::ustring scriptTooltipFor(gig::Instrument* instrument, int index) {
3015      Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));      Glib::ustring name(gig_to_utf8(instrument->pInfo->Name));
3016      const int iScriptSlots = instrument->ScriptSlotCount();      const int iScriptSlots = instrument->ScriptSlotCount();
3017      Glib::ustring tooltip = "<u>(" + ToString(index) + ") „"  + name + "”</u>\n\n";      Glib::ustring tooltip = "<u>(" + ToString(index) + ") “"  + name + "”</u>\n\n";
3018      if (!iScriptSlots)      if (!iScriptSlots)
3019          tooltip += "<span foreground='red'><i>No script assigned</i></span>";          tooltip += "<span foreground='red'><i>No script assigned</i></span>";
3020      else {      else {
3021          for (int i = 0; i < iScriptSlots; ++i) {          for (int i = 0; i < iScriptSlots; ++i) {
3022              tooltip += "• " + ToString(i+1) + ". Script:  „<span foreground='#46DEFF'><b>" +              tooltip += "• " + ToString(i+1) + ". Script: “<span foreground='#46DEFF'><b>" +
3023                         instrument->GetScriptOfSlot(i)->Name + "</b></span>”";                         instrument->GetScriptOfSlot(i)->Name + "</b></span>”";
3024              if (i + 1 < iScriptSlots) tooltip += "\n\n";              if (i + 1 < iScriptSlots) tooltip += "\n\n";
3025          }          }
# Line 3057  void MainWindow::load_gig(gig::File* gig Line 3041  void MainWindow::load_gig(gig::File* gig
3041      file_is_changed = false;      file_is_changed = false;
3042    
3043      propDialog.set_file(gig);      propDialog.set_file(gig);
     propDialog.set_info(gig->pInfo);  
3044    
3045      instrument_name_connection.block();      instrument_name_connection.block();
3046      int index = 0;      int index = 0;
# Line 5034  void MainWindow::on_action_merge_files() Line 5017  void MainWindow::on_action_merge_files()
5017  #endif  #endif
5018    
5019      if (dialog.run() == Gtk::RESPONSE_OK) {      if (dialog.run() == Gtk::RESPONSE_OK) {
5020    #ifdef GLIB_THREADS
5021          printf("on_action_merge_files self=%p\n",          printf("on_action_merge_files self=%p\n",
5022                 static_cast<void*>(Glib::Threads::Thread::self()));                 static_cast<void*>(Glib::Threads::Thread::self()));
5023    #else
5024            std::cout << "on_action_merge_files self=" <<
5025                std::this_thread::get_id() << "\n";
5026    #endif
5027          std::vector<std::string> filenames = dialog.get_filenames();          std::vector<std::string> filenames = dialog.get_filenames();
5028    
5029          // merge the selected files to the currently open .gig file          // merge the selected files to the currently open .gig file

Legend:
Removed from v.3450  
changed lines
  Added in v.3472

  ViewVC Help
Powered by ViewVC