Changeset 1464
- Timestamp:
- 12/02/09 03:02:10 (4 years ago)
- Files:
-
- 1 modified
-
trunk/gui/src/SampleEditor/SampleEditor.cpp (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/src/SampleEditor/SampleEditor.cpp
r1452 r1464 159 159 { 160 160 Hydrogen *pEngine = Hydrogen::get_instance(); 161 H2Core::Instrument * m_pInstrument = NULL;161 H2Core::Instrument *pInstrument = NULL; 162 162 Sample* pSample = NULL; 163 163 Song *pSong = Hydrogen::get_instance()->getSong(); … … 170 170 171 171 if (nInstr == -1) { 172 m_pInstrument = NULL;172 pInstrument = NULL; 173 173 } 174 174 else { 175 m_pInstrument = pInstrList->get( nInstr );176 //INFOLOG( "new instr: " + m_pInstrument->m_sName );177 } 178 } 179 H2Core::InstrumentLayer *pLayer = m_pInstrument->get_layer( m_pSelectedLayer );175 pInstrument = pInstrList->get( nInstr ); 176 //INFOLOG( "new instr: " + pInstrument->m_sName ); 177 } 178 } 179 H2Core::InstrumentLayer *pLayer = pInstrument->get_layer( m_pSelectedLayer ); 180 180 if ( pLayer ) { 181 181 pSample = pLayer->get_sample(); … … 293 293 void SampleEditor::openDisplays() 294 294 { 295 H2Core::Instrument * m_pInstrument = NULL;295 H2Core::Instrument *pInstrument = NULL; 296 296 Song *pSong = Hydrogen::get_instance()->getSong(); 297 297 if (pSong != NULL) { … … 303 303 304 304 if (nInstr == -1) { 305 m_pInstrument = NULL;305 pInstrument = NULL; 306 306 } 307 307 else { 308 m_pInstrument = pInstrList->get( nInstr );309 //INFOLOG( "new instr: " + m_pInstrument->m_sName );308 pInstrument = pInstrList->get( nInstr ); 309 //INFOLOG( "new instr: " + pInstrument->m_sName ); 310 310 } 311 311 } … … 390 390 AudioEngine::get_instance()->lock( RIGHT_HERE ); 391 391 392 H2Core::Instrument * m_pInstrument = NULL;392 H2Core::Instrument *pInstrument = NULL; 393 393 Song *pSong = Hydrogen::get_instance()->getSong(); 394 394 if (pSong != NULL) { … … 400 400 401 401 if (nInstr == -1) { 402 m_pInstrument = NULL;402 pInstrument = NULL; 403 403 } 404 404 else { 405 m_pInstrument = pInstrList->get( nInstr );405 pInstrument = pInstrList->get( nInstr ); 406 406 } 407 407 } 408 408 409 H2Core::InstrumentLayer *pLayer = m_pInstrument->get_layer( m_pSelectedLayer );409 H2Core::InstrumentLayer *pLayer = pInstrument->get_layer( m_pSelectedLayer ); 410 410 411 411 Sample *oldSample = pLayer->get_sample(); … … 536 536 void SampleEditor::on_PlayPushButton_clicked() 537 537 { 538 538 if (PlayPushButton->text() == "Stop" ){ 539 testpTimer(); 540 return; 541 } 539 542 const int selectedlayer = InstrumentEditorPanel::get_instance()->getselectedLayer(); 540 543 const float pan_L = 0.5f; … … 574 577 } 575 578 m_pTargetDisplayTimer->start(40); // update ruler at 25 fps 579 PlayPushButton->setText( QString( "Stop") ); 576 580 577 581 } … … 581 585 void SampleEditor::on_PlayOrigPushButton_clicked() 582 586 { 587 if (PlayOrigPushButton->text() == "Stop" ){ 588 testpTimer(); 589 return; 590 } 583 591 Sample *pNewSample = Sample::load( m_samplename ); 584 592 if ( pNewSample ){ … … 592 600 m_pTimer->start(40); // update ruler at 25 fps 593 601 m_prealtimeframeend = Hydrogen::get_instance()->getRealtimeFrames() + m_pslframes; 602 PlayOrigPushButton->setText( QString( "Stop") ); 594 603 } 595 604 … … 613 622 m_pMainSampleWaveDisplay->paintLocatorEvent( -1 , false); 614 623 m_pTimer->stop(); 624 PlayPushButton->setText( QString("&Play") ); 625 PlayOrigPushButton->setText( QString( "P&lay original sample") ); 615 626 m_pPlayButton = false; 616 627 } … … 636 647 m_pTargetSampleView->paintLocatorEventTargetDisplay( -1 , false); 637 648 m_pTargetDisplayTimer->stop(); 638 // m_pPlayButton = false; 649 PlayPushButton->setText(QString( "&Play") ); 650 PlayOrigPushButton->setText( QString( "P&lay original sample") ); 651 m_pPlayButton = false; 639 652 } 640 653 } … … 901 914 void SampleEditor::testpTimer() 902 915 { 903 if ( m_pTimer->isActive() ){916 if ( m_pTimer->isActive() || m_pTargetDisplayTimer->isActive() ){ 904 917 m_pMainSampleWaveDisplay->paintLocatorEvent( -1 , false); 905 918 m_pTimer->stop(); 919 m_pTargetDisplayTimer->stop(); 920 PlayPushButton->setText( QString( "&Play" ) ); 921 PlayOrigPushButton->setText( QString( "P&lay original sample") ); 906 922 AudioEngine::get_instance()->get_sampler()->stop_playing_notes(); 907 923 m_pPlayButton = false;