Changeset 2482
- Timestamp:
- 04/02/12 22:45:04 (14 months ago)
- Location:
- trunk
- Files:
-
- 8 modified
-
data/hydrogen.default.conf (modified) (1 diff)
-
src/core/include/hydrogen/Preferences.h (modified) (2 diffs)
-
src/core/src/IO/jack_output.cpp (modified) (3 diffs)
-
src/core/src/preferences.cpp (modified) (3 diffs)
-
src/gui/src/MainForm.cpp (modified) (3 diffs)
-
src/gui/src/MainForm.h (modified) (1 diff)
-
src/gui/src/PreferencesDialog.cpp (modified) (2 diffs)
-
src/gui/src/UI/PreferencesDialog_UI.ui (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/hydrogen.default.conf
r2335 r2482 14 14 <useLash>false</useLash> 15 15 <useTimeLine>false</useTimeLine> 16 <maxBars>400</maxBars> 17 <JackSessionUseSessionDir>true</JackSessionUseSessionDir> 16 <maxBars>400</maxBars> 18 17 <showDevelWarning>true</showDevelWarning> 19 18 <hearNewNotes>true</hearNewNotes> -
trunk/src/core/include/hydrogen/Preferences.h
r2467 r2482 587 587 } 588 588 589 bool getJackSessionUseSessionDir(){590 return m_bjackSessionUseSessionDir;591 }592 void setJackSessionUseSessionDir( bool val ){593 m_bjackSessionUseSessionDir = val;594 }595 589 #endif 596 590 … … 659 653 QString jackSessionUUID; 660 654 QString jackSessionApplicationPath; 661 bool m_bjackSessionUseSessionDir;662 655 #endif 663 656 bool waitingForSessionHandler; -
trunk/src/core/src/IO/jack_output.cpp
r2470 r2482 759 759 SAVE_SESSION, 760 760 SAVE_AND_QUIT, 761 SAVE_TEMPLATE, 762 SAVE_SESSION_NEW_FILE 761 SAVE_TEMPLATE 763 762 }; 764 763 … … 767 766 /* Valid Song is needed */ 768 767 if(Hydrogen::get_instance()->getSong()->get_filename().isEmpty()){ 769 EventQueue::get_instance()->push_event(EVENT_JACK_SESSION, SAVE_SESSION_NEW_FILE); 770 jack_session_reply(client, ev ); 771 jack_session_event_free (ev); 772 return; 768 Hydrogen::get_instance()->getSong()->set_filename("Untitled_Song"); 773 769 } 770 if(Hydrogen::get_instance()->getSong()->get_filename().contains(" ")){ 771 QStringList removeWhiteSpaces = Hydrogen::get_instance()->getSong()->get_filename().split(" "); 772 Hydrogen::get_instance()->getSong()->set_filename( removeWhiteSpaces.join("_") ); 773 } 774 774 775 775 QString songfilename; 776 if(Preferences::get_instance()->getJackSessionUseSessionDir()){ 777 QString jackSessionDirectory = (QString)ev->session_dir; 778 QStringList list1 = Hydrogen::get_instance()->getSong()->get_filename().split("/"); 779 QString realFillename = list1[list1.size()-1]; 780 Hydrogen::get_instance()->getSong()->set_filename(jackSessionDirectory + realFillename); 781 songfilename = "\"${SESSION_DIR}\"" + realFillename; 782 }else 783 { 784 songfilename = Hydrogen::get_instance()->getSong()->get_filename(); 785 } 786 776 QString jackSessionDirectory = (QString)ev->session_dir; 777 QStringList list1 = Hydrogen::get_instance()->getSong()->get_filename().split("/"); 778 QString realFillename = list1[list1.size()-1]; 779 Hydrogen::get_instance()->getSong()->set_filename(jackSessionDirectory + realFillename); 780 songfilename = "\"${SESSION_DIR}\"" + realFillename; 787 781 788 782 QString retval = QString(Preferences::get_instance()->getJackSessionApplicationPath() + " -s" + songfilename + " --jacksessionid " + ev->client_uuid); … … 793 787 } 794 788 if (ev->type == JackSessionSaveAndQuit) { 795 if(Preferences::get_instance()->getJackSessionUseSessionDir()){796 789 EventQueue::get_instance()->push_event(EVENT_JACK_SESSION, SAVE_SESSION); 797 } 798 EventQueue::get_instance()->push_event(EVENT_JACK_SESSION, SAVE_AND_QUIT); 790 EventQueue::get_instance()->push_event(EVENT_JACK_SESSION, SAVE_AND_QUIT); 799 791 } 800 792 -
trunk/src/core/src/preferences.cpp
r2467 r2482 73 73 m_brestartLash = false; 74 74 m_bsetLash = false; 75 76 #ifdef H2CORE_HAVE_JACKSESSION77 m_bjackSessionUseSessionDir = false;78 #endif79 75 80 76 //init pre delete default … … 410 406 hearNewNotes = LocalFileMng::readXmlBool( rootNode, "hearNewNotes", hearNewNotes ); 411 407 quantizeEvents = LocalFileMng::readXmlBool( rootNode, "quantizeEvents", quantizeEvents ); 412 413 #ifdef H2CORE_HAVE_JACKSESSION414 m_bjackSessionUseSessionDir = LocalFileMng::readXmlBool( rootNode, "JackSessionUseSessionDir", m_bjackSessionUseSessionDir );415 #endif416 408 417 409 //rubberband … … 764 756 LocalFileMng::writeXmlString( rootNode, "postDelete", QString("%1").arg(m_nRecPostDelete) ); 765 757 766 #ifdef H2CORE_HAVE_JACKSESSION767 LocalFileMng::writeXmlString( rootNode, "JackSessionUseSessionDir", m_bjackSessionUseSessionDir ? "true": "false" );768 #endif769 770 758 //show development version warning 771 759 LocalFileMng::writeXmlString( rootNode, "showDevelWarning", m_bShowDevelWarning ? "true": "false" ); -
trunk/src/gui/src/MainForm.cpp
r2481 r2482 487 487 488 488 QString filename; 489 if (fd->exec() == QDialog::Accepted) {489 if (fd->exec() == QDialog::Accepted) { 490 490 filename = fd->selectedFiles().first(); 491 491 } … … 511 511 QString filename = song->get_filename(); 512 512 513 if ( filename.isEmpty() ) {514 // just in case!515 return action_file_save_as();516 }513 if ( filename.isEmpty() ) { 514 // just in case! 515 return action_file_save_as(); 516 } 517 517 518 518 bool saved = false; … … 1469 1469 action_file_exit(); 1470 1470 break; 1471 case 3:1472 action_file_save();1473 QMessageBox::information( this, "Hydrogen", trUtf8( "Sorry, the Hydrogen-Songfile is not saved properly in this Jack-Session! You have to repeat the \"Save-Session\" procedure from your Jack-Session-Manager.") );1474 1471 } 1475 1472 -
trunk/src/gui/src/MainForm.h
r2481 r2482 68 68 void action_file_open(); 69 69 void action_file_openDemo(); 70 void action_file_save();70 void action_file_save(); 71 71 void action_file_save_as(); 72 72 void action_file_openPattern(); -
trunk/src/gui/src/PreferencesDialog.cpp
r2471 r2482 261 261 #endif 262 262 263 #ifdef H2CORE_HAVE_JACKSESSION264 useJackSessinStoreFiles->setVisible(true);265 useJackSessinStoreFiles->setChecked(pPref->getJackSessionUseSessionDir());266 #else267 useJackSessinStoreFiles->setVisible(false);268 #endif269 270 263 m_bNeedDriverRestart = false; 271 264 connect(m_pMidiDriverComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT( onMidiDriverComboBoxIndexChanged(int) )); … … 421 414 //path to rubberband 422 415 pPref-> m_rubberBandCLIexecutable = rubberbandLineEdit->text(); 423 424 #ifdef H2CORE_HAVE_JACKSESSION425 pPref->setJackSessionUseSessionDir(useJackSessinStoreFiles->isChecked());426 #endif427 416 428 417 //check preferences -
trunk/src/gui/src/UI/PreferencesDialog_UI.ui
r2359 r2482 331 331 </property> 332 332 </widget> 333 <widget class="QCheckBox" name="useJackSessinStoreFiles">334 <property name="geometry">335 <rect>336 <x>10</x>337 <y>100</y>338 <width>511</width>339 <height>31</height>340 </rect>341 </property>342 <property name="text">343 <string>Save song files in Jack Session Directory (default on)</string>344 </property>345 </widget>346 333 </widget> 347 334 <widget class="QWidget" name="tab_2">