Changeset 371 for trunk/libs/hydrogen/src/sampler/sampler.cpp
- Timestamp:
- 08/21/08 23:52:14 (5 years ago)
- Files:
-
- 1 modified
-
trunk/libs/hydrogen/src/sampler/sampler.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/libs/hydrogen/src/sampler/sampler.cpp
r260 r371 109 109 Note *oldNote = __playing_notes_queue[ 0 ]; 110 110 __playing_notes_queue.erase( __playing_notes_queue.begin() ); 111 oldNote->get_instrument()->dequeue(); 111 112 delete oldNote; // FIXME: send note-off instead of removing the note from the list? 112 113 } … … 121 122 if ( res == 1 ) { // la nota e' finita 122 123 __playing_notes_queue.erase( __playing_notes_queue.begin() + i ); 124 pNote->get_instrument()->dequeue(); 123 125 delete pNote; 124 126 pNote = NULL; … … 658 660 if ( pNote->get_instrument() == instrument ) { 659 661 delete pNote; 662 instrument->dequeue(); 660 663 __playing_notes_queue.erase( __playing_notes_queue.begin() + i ); 661 664 } … … 666 669 for ( unsigned i = 0; i < __playing_notes_queue.size(); ++i ) { 667 670 Note *pNote = __playing_notes_queue[i]; 671 pNote->get_instrument()->dequeue(); 668 672 delete pNote; 669 673 } … … 689 693 stop_playing_notes( __preview_instrument ); 690 694 note_on( previewNote ); 695 __preview_instrument->enqueue(); 691 696 692 697 AudioEngine::get_instance()->unlock(); … … 697 702 void Sampler::preview_instrument( Instrument* instr ) 698 703 { 704 Instrument * old_preview; 699 705 AudioEngine::get_instance()->lock( "Sampler::previewInstrument" ); 700 706 701 707 stop_playing_notes( __preview_instrument ); 702 708 703 delete __preview_instrument;709 old_preview = __preview_instrument 704 710 __preview_instrument = instr; 705 711 … … 707 713 708 714 note_on( previewNote ); // exclusive note 715 instr->enqueue(); 709 716 AudioEngine::get_instance()->unlock(); 717 delete old_preview; 710 718 } 711 719