Changeset 614

Show
Ignore:
Timestamp:
11/02/08 14:57:04 (2 months ago)
Author:
wolke
Message:

some changes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/new_fx_rack_and_sample_fun/gui/src/HydrogenApp.cpp

    r608 r614  
    322322 
    323323 
    324 void HydrogenApp::showSampleEditor( QString name, Sample* Sample ) 
     324void HydrogenApp::showSampleEditor( QString name, Sample *Sample ) 
    325325{ 
    326326        if ( m_pSampleEditor ){ 
  • branches/new_fx_rack_and_sample_fun/gui/src/HydrogenApp.h

    r608 r614  
    7474                void showAudioEngineInfoForm(); 
    7575                void showPlaylistDialog(); 
    76                 void showSampleEditor( QString name,  H2Core::Sample* Sample ); 
     76                void showSampleEditor( QString name,  H2Core::Sample *Sample ); 
    7777 
    7878                Mixer* getMixer() {     return m_pMixer;        } 
  • branches/new_fx_rack_and_sample_fun/gui/src/InstrumentEditor/InstrumentEditorPanel.cpp

    r436 r614  
    5959 
    6060        this->setLayout( vbox ); 
     61        m_player = 0; 
    6162} 
    6263 
     
    7374{ 
    7475        m_pInstrumentEditor->selectLayer( nLayer ); 
     76        m_player = nLayer; 
    7577} 
    7678 
    7779 
     80 
     81 
  • branches/new_fx_rack_and_sample_fun/gui/src/InstrumentEditor/InstrumentEditorPanel.h

    r377 r614  
    3939 
    4040                void selectLayer( int nLayer ); 
     41                 
     42                int getselectedLayer() { 
     43                        return m_player; 
     44                } 
     45 
    4146        private: 
    4247                static InstrumentEditorPanel* m_pInstance; 
     
    4449 
    4550                InstrumentEditorPanel( QWidget *pParent ); 
     51                int m_player; 
     52                 
    4653}; 
    4754 
  • branches/new_fx_rack_and_sample_fun/gui/src/SampleEditor/SampleEditor.cpp

    r613 r614  
    2424#include "../HydrogenApp.h" 
    2525#include "InstrumentEditor/InstrumentEditor.h" 
     26#include "InstrumentEditor/InstrumentEditorPanel.h" 
    2627#include "../widgets/Button.h" 
    2728 
     
    3536#include <hydrogen/sample.h> 
    3637#include <hydrogen/audio_engine.h> 
     38#include <hydrogen/hydrogen.h> 
    3739 
    3840#include <QModelIndex> 
     
    122124        connect( LoopFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedLoopFrameSpinBox(int) ) ); 
    123125        connect( EndFrameSpinBox, SIGNAL( valueChanged( int ) ), this, SLOT( valueChangedEndFrameSpinBox(int) ) ); 
     126 
    124127} 
    125128 
     
    200203 
    201204 
     205 
    202206void SampleEditor::mouseReleaseEvent(QMouseEvent *ev) 
    203207{ 
    204208 
    205209} 
     210 
     211 
    206212 
    207213void SampleEditor::returnAllMainWaveDisplayValues() 
     
    220226        m_ponewayEnd = true; 
    221227} 
     228 
    222229 
    223230 
     
    257264 
    258265 
     266 
    259267void SampleEditor::valueChangedEndFrameSpinBox( int ) 
    260268{ 
     
    273281 
    274282 
     283 
    275284void SampleEditor::on_verticalzoomSlider_valueChanged( int value ) 
    276285{ 
     
    278287        m_pSampleAdjustView->setDetailSamplePosition( m_pdetailframe, m_pzoomfactor, m_plineColor ); 
    279288} 
     289 
     290 
     291 
     292void SampleEditor::on_PlayPushButton_clicked() 
     293{ 
     294                const int selectedlayer = InstrumentEditorPanel::getInstance()->getselectedLayer(); 
     295                const float pan_L = 0.5f; 
     296                const float pan_R = 0.5f; 
     297                const int nLength = -1; 
     298                const float fPitch = 0.0f; 
     299                Song *pSong = Hydrogen::get_instance()->getSong(); 
     300                 
     301                Instrument *pInstr = pSong->get_instrument_list()->get( Hydrogen::get_instance()->getSelectedInstrumentNumber() ); 
     302                 
     303                Note *pNote = new Note( pInstr, 0, pInstr->get_layer( selectedlayer )->get_end_velocity() - 0.01, pan_L, pan_R, nLength, fPitch); 
     304                AudioEngine::get_instance()->get_sampler()->note_on(pNote);      
     305} 
  • branches/new_fx_rack_and_sample_fun/gui/src/SampleEditor/SampleEditor.h

    r613 r614  
    5050        public: 
    5151                 
    52                 SampleEditor( QWidget* pParent, H2Core::Sample* Sample ); 
     52                SampleEditor( QWidget* pParent, H2Core::Sample *Sample ); 
    5353                ~SampleEditor(); 
    5454 
     
    6767                void valueChangedEndFrameSpinBox( int ); 
    6868                void on_verticalzoomSlider_valueChanged ( int value ); 
     69                void on_PlayPushButton_clicked(); 
    6970 
    7071        private: 
     
    7879*/               
    7980        QString m_samplename; 
    80         H2Core::Sample* m_pSample; 
     81        H2Core::Sample *m_pSample; 
    8182 
    8283        bool m_sample_is_modified;      ///< true if sample is modified