Changeset 625

Show
Ignore:
Timestamp:
11/05/08 09:51:11 (2 months ago)
Author:
wolke
Message:

samples play reverse and pingpong

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/new_fx_rack_and_sample_fun/Sconstruct

    r505 r625  
    6666 
    6767 
    68                 includes.append( '/usr/lib/lash-1.0' ) 
     68                if lash: includes.append( '/usr/lib/lash-1.0' ) 
    6969 
    7070        if libarchive: cppflags.append('-DLIBARCHIVE_SUPPORT') 
  • branches/new_fx_rack_and_sample_fun/gui/src/ExportSongDialog.cpp

    r171 r625  
    136136        m_pProgressBar->setValue( nValue ); 
    137137        if ( nValue == 100 ) { 
    138           //INFOLOG("SONO A 100"); 
    139         Hydrogen::get_instance()->stopExportSong(); 
    140         m_bExporting = false; 
     138        //INFOLOG("SONO A 100");  
     139 
     140                Hydrogen::get_instance()->stopExportSong();  
     141                m_bExporting = false;  
     142                QFile check( exportNameTxt->text() );  
     143                if ( ! check.exists() ) {  
     144                        QMessageBox::information( this, "Hydrogen", trUtf8("Export failed!") );  
     145                }  
     146        } 
    141147        accept(); 
    142         } 
    143148} 
  • branches/new_fx_rack_and_sample_fun/gui/src/MainForm.cpp

    r597 r625  
    624624                { 
    625625                        _ERRORLOG ( "Error saving the pattern" ); 
     626                        QMessageBox::warning( this, "Hydrogen", trUtf8("Could not export pattern.") );  
    626627                } 
    627628        } 
  • branches/new_fx_rack_and_sample_fun/gui/src/PatternEditor/NotePropertiesRuler.cpp

    r601 r625  
    598598        if ( !pPatternEditor->isUsingTriplets() ) { 
    599599 
    600                 for (uint i = 0; i < MAX_NOTES + 1; i++) { 
     600                for (uint i = 0; i < nNotes +1 ; i++) { 
    601601                        uint x = 20 + i * m_nGridWidth; 
    602602 
     
    637637                int nSize = 4 * MAX_NOTES / (nBase * nResolution); 
    638638 
    639                 for (uint i = 0; i < MAX_NOTES + 1; i++) { 
     639                for (uint i = 0; i < nNotes +1; i++) { 
    640640                        uint x = 20 + i * m_nGridWidth; 
    641641 
     
    753753        if ( !pPatternEditor->isUsingTriplets() ) { 
    754754  
    755                 for (uint i = 0; i < MAX_NOTES + 1; i++) { 
     755                for (uint i = 0; i < nNotes + 1; i++) { 
    756756                        uint x = 20 + i * m_nGridWidth; 
    757757  
     
    792792                int nSize = 4 * MAX_NOTES / (nBase * nResolution); 
    793793  
    794                 for (uint i = 0; i < MAX_NOTES + 1; i++) { 
     794                for (uint i = 0; i < nNotes + 1; i++) { 
    795795                        uint x = 20 + i * m_nGridWidth; 
    796796  
  • branches/new_fx_rack_and_sample_fun/gui/src/SampleEditor/SampleEditor.cpp

    r623 r625  
    285285                                                            m_loop_frame, 
    286286                                                            m_end_frame, 
    287                                                             m_repeats ); 
     287                                                            m_repeats, 
     288                                                            m_sample_mode); 
    288289 
    289290                AudioEngine::get_instance()->lock( "SampeEditor::insert new sample" ); 
     
    440441        } 
    441442 
    442         setSamplelengthFrames(); 
     443        m_pslframes = pNewSample->get_n_frames(); 
    443444        m_pMainSampleWaveDisplay->paintLocatorEvent( StartFrameSpinBox->value() / m_divider + 24 , true); 
    444445        m_pSampleAdjustView->setDetailSamplePosition( m_start_frame, m_pzoomfactor , 0); 
  • branches/new_fx_rack_and_sample_fun/libs/hydrogen/include/hydrogen/sample.h

    r623 r625  
    8383                                const unsigned loppframe, 
    8484                                const unsigned endframe, 
    85                                 const int loops ); 
     85                                const int loops, 
     86                                const QString loopmode ); 
    8687 
    8788 
  • branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/local_file_mgr.cpp

    r602 r625  
    249249 
    250250//test if the file exists  
    251         QFile testfile(sPatternXmlFilename); 
     251        QFile testfile( sPatternXmlFilename ); 
    252252        if ( testfile.exists() && mode == 1) 
    253253                return 1; 
     
    298298        doc.SaveFile(); 
    299299 
    300  
     300        QFile anotherTestfile( sPatternXmlFilename );  
     301                if ( ! anotherTestfile.exists() )  
     302                return 1;  
    301303 
    302304        return 0; // ok 
  • branches/new_fx_rack_and_sample_fun/libs/hydrogen/src/sample.cpp

    r623 r625  
    159159                                const unsigned loppframe, 
    160160                                const unsigned endframe, 
    161                                 const int loops ) 
    162 
     161                                const int loops, 
     162                                const QString loopmode) 
     163
     164        _INFOLOG( QString( "mode: " + loopmode) ); 
     165        _INFOLOG( QString( "loops: " ).arg( loops ) ); 
    163166        // file exists? 
    164167        if ( QFile( filename ).exists() == false ) { 
     
    234237                looptempdata_r[i] = origdata_r[z]; 
    235238        } 
     239 
     240                 
     241        if ( loopmode == "reverse" ){ 
     242                reverse(looptempdata_l, looptempdata_l + looplength); 
     243                reverse(looptempdata_r, looptempdata_r + looplength); 
     244        } 
     245 
     246        if ( loopmode == "reverse" && loops > 0 && startframe == loppframe ){ 
     247                reverse( tempdata_l, tempdata_l + onesamplelength ); 
     248                reverse( tempdata_r, tempdata_r + onesamplelength );             
     249                } 
     250 
    236251         
    237252        for ( int i = 0; i< loops ;i++){ 
     253 
    238254                unsigned tempdataend = onesamplelength + ( looplength * i ); 
    239255                copy( looptempdata_l, looptempdata_l+looplength ,tempdata_l+tempdataend ); 
    240256                copy( looptempdata_r, looptempdata_r+looplength ,tempdata_r+tempdataend ); 
    241  
    242         } 
     257                if ( loopmode == "pingpong" ){ 
     258                        reverse(looptempdata_l, looptempdata_l + looplength); 
     259                        reverse(looptempdata_r, looptempdata_r + looplength); 
     260                } 
     261 
     262        } 
     263 
     264         
     265        if ( loops == 0 && loopmode == "reverse" ){ 
     266                reverse( tempdata_l + loppframe, tempdata_l + newlength); 
     267                reverse( tempdata_r + loppframe, tempdata_r + newlength);                
     268                } 
    243269 
    244270