diff --git a/cmake/modules/DetectMachine.cmake b/cmake/modules/DetectMachine.cmake index b3aab2cfb..9642da3c2 100644 --- a/cmake/modules/DetectMachine.cmake +++ b/cmake/modules/DetectMachine.cmake @@ -39,11 +39,7 @@ ENDIF(IS_X86) IF(CMAKE_INSTALL_LIBDIR) SET(LIB_DIR "${CMAKE_INSTALL_LIBDIR}") ELSE(CMAKE_INSTALL_LIBDIR) - IF(LMMS_HOST_X86_64) - SET(LIB_DIR lib64) - ELSE(LMMS_HOST_X86_64) - SET(LIB_DIR lib) - ENDIF(LMMS_HOST_X86_64) + SET(LIB_DIR lib) ENDIF(CMAKE_INSTALL_LIBDIR) diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index 09d012792..7b0a6ae4d 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -2,7 +2,7 @@ * AudioSampleRecorder.h - device-class that implements recording * audio-buffers into RAM * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,7 +31,7 @@ #include "AudioDevice.h" -class sampleBuffer; +class SampleBuffer; class AudioSampleRecorder : public AudioDevice @@ -42,7 +42,7 @@ public: virtual ~AudioSampleRecorder(); f_cnt_t framesRecorded() const; - void createSampleBuffer( sampleBuffer * * _sample_buf ); + void createSampleBuffer( SampleBuffer** sampleBuffer ); private: diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index 94dbe66f9..bf8cb5697 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -2,7 +2,7 @@ * AutomationTrack.h - declaration of class AutomationTrack, which handles * automation of objects without a track * - * Copyright (c) 2008-2010 Tobias Doerffel + * Copyright (c) 2008-2014 Tobias Doerffel * Copyright (c) 2006-2008 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -33,7 +33,7 @@ class AutomationTrack : public track { public: - AutomationTrack( trackContainer * _tc, bool _hidden = false ); + AutomationTrack( TrackContainer* tc, bool _hidden = false ); virtual ~AutomationTrack(); virtual bool play( const midiTime & _start, const fpp_t _frames, @@ -45,7 +45,7 @@ public: return "automationtrack"; } - virtual trackView * createView( trackContainerView * ); + virtual trackView * createView( TrackContainerView* ); virtual trackContentObject * createTCO( const midiTime & _pos ); virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -62,7 +62,7 @@ private: class AutomationTrackView : public trackView { public: - AutomationTrackView( AutomationTrack * _at, trackContainerView * _tcv ); + AutomationTrackView( AutomationTrack* at, TrackContainerView* tcv ); virtual ~AutomationTrackView(); virtual void dragEnterEvent( QDragEnterEvent * _dee ); diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index f7497d860..1d795bd9e 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -1,7 +1,7 @@ /* * EnvelopeAndLfoParameters.h - class EnvelopeAndLfoParameters * - * Copyright (c) 2004-2010 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -29,7 +29,7 @@ #include "JournallingObject.h" #include "AutomatableModel.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "TempoSyncKnobModel.h" #include "lmms_basics.h" @@ -158,7 +158,7 @@ private: bool m_lfoAmountIsZero; sample_t * m_lfoShapeData; bool m_bad_lfoShapeData; - sampleBuffer m_userWave; + SampleBuffer m_userWave; enum LfoShapes { diff --git a/include/ImportFilter.h b/include/ImportFilter.h index 676114cbb..284dfe12b 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -2,7 +2,7 @@ * ImportFilter.h - declaration of class ImportFilter, the base-class for all * file import filters * - * Copyright (c) 2006-2009 Tobias Doerffel + * Copyright (c) 2006-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,7 +31,7 @@ #include "Plugin.h" -class trackContainer; +class TrackContainer; class EXPORT ImportFilter : public Plugin @@ -45,11 +45,11 @@ public: // tries to import given file to given track-container by having all // available import-filters to try to import the file static void import( const QString & _file_to_import, - trackContainer * _tc ); + TrackContainer* tc ); protected: - virtual bool tryImport( trackContainer * _tc ) = 0; + virtual bool tryImport( TrackContainer* tc ) = 0; const QFile & file() const { diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 1dc4383c6..af1c79288 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -2,7 +2,7 @@ * InstrumentTrack.h - declaration of class InstrumentTrack, a track + window * which holds an instrument-plugin * - * Copyright (c) 2004-2012 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -64,7 +64,7 @@ class EXPORT InstrumentTrack : public track, public MidiEventProcessor Q_OBJECT mapPropertyFromModel(int,getVolume,setVolume,m_volumeModel); public: - InstrumentTrack( trackContainer * _tc ); + InstrumentTrack( TrackContainer* tc ); virtual ~InstrumentTrack(); // used by instrument @@ -123,7 +123,7 @@ public: const f_cnt_t _frame_base, Sint16 _tco_num = -1 ); // create new view for me - virtual trackView * createView( trackContainerView * _tcv ); + virtual trackView * createView( TrackContainerView* tcv ); // create new track-content-object = pattern virtual trackContentObject * createTCO( const midiTime & _pos ); @@ -254,7 +254,7 @@ class InstrumentTrackView : public trackView { Q_OBJECT public: - InstrumentTrackView( InstrumentTrack * _it, trackContainerView * _tc ); + InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tc ); virtual ~InstrumentTrackView(); InstrumentTrackWindow * getInstrumentTrackWindow(); diff --git a/include/Oscillator.h b/include/Oscillator.h index edf7c0341..cca73ab86 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -1,7 +1,7 @@ /* * Oscillator.h - declaration of class Oscillator * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,11 +33,11 @@ #include #endif -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "lmms_constants.h" -class sampleBuffer; +class SampleBuffer; class IntModel; @@ -81,7 +81,7 @@ public: } - inline void setUserWave( const sampleBuffer * _wave ) + inline void setUserWave( const SampleBuffer * _wave ) { m_userWave = _wave; } @@ -165,7 +165,7 @@ private: Oscillator * m_subOsc; float m_phaseOffset; float m_phase; - const sampleBuffer * m_userWave; + const SampleBuffer * m_userWave; void updateNoSub( sampleFrame * _ab, const fpp_t _frames, diff --git a/include/sample_buffer.h b/include/SampleBuffer.h similarity index 89% rename from include/sample_buffer.h rename to include/SampleBuffer.h index 7993a23c7..22038b2b3 100644 --- a/include/sample_buffer.h +++ b/include/SampleBuffer.h @@ -1,7 +1,7 @@ /* - * sample_buffer.h - container-class sampleBuffer + * SampleBuffer.h - container-class SampleBuffer * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -42,7 +42,7 @@ class QPainter; -class EXPORT sampleBuffer : public QObject, public sharedObject +class EXPORT SampleBuffer : public QObject, public sharedObject { Q_OBJECT public: @@ -58,19 +58,19 @@ public: const bool m_varyingPitch; SRC_STATE * m_resamplingData; - friend class sampleBuffer; + friend class SampleBuffer; } ; // constructor which either loads sample _audio_file or decodes // base64-data out of string - sampleBuffer( const QString & _audio_file = QString(), + SampleBuffer( const QString & _audio_file = QString(), bool _is_base64_data = false ); - sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ); - sampleBuffer( const f_cnt_t _frames ); + SampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ); + SampleBuffer( const f_cnt_t _frames ); - virtual ~sampleBuffer(); + virtual ~SampleBuffer(); bool play( sampleFrame * _ab, handleState * _state, const fpp_t _frames, @@ -166,12 +166,12 @@ public: QString & toBase64( QString & _dst ) const; - static sampleBuffer * resample( sampleFrame * _data, + static SampleBuffer * resample( sampleFrame * _data, const f_cnt_t _frames, const sample_rate_t _src_sr, const sample_rate_t _dst_sr ); - static inline sampleBuffer * resample( sampleBuffer * _buf, + static inline SampleBuffer * resample( SampleBuffer * _buf, const sample_rate_t _src_sr, const sample_rate_t _dst_sr ) { @@ -219,6 +219,8 @@ public slots: private: void update( bool _keep_settings = false ); + void convertIntToFloat ( int_sample_t * & _ibuf, f_cnt_t _frames, int _channels); + void directFloatWrite ( sample_t * & _fbuf, f_cnt_t _frames, int _channels); f_cnt_t decodeSampleSF( const char * _f, int_sample_t * & _buf, ch_cnt_t & _channels, diff --git a/include/sample_play_handle.h b/include/SamplePlayHandle.h similarity index 78% rename from include/sample_play_handle.h rename to include/SamplePlayHandle.h index 2b590e892..a9ffd4112 100644 --- a/include/sample_play_handle.h +++ b/include/SamplePlayHandle.h @@ -1,7 +1,7 @@ /* - * sample_play_handle.h - play-handle for playing a sample + * SamplePlayHandle.h - play-handle for playing a sample * - * Copyright (c) 2005-2008 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -22,29 +22,28 @@ * */ - #ifndef _SAMPLE_PLAY_HANDLE_H #define _SAMPLE_PLAY_HANDLE_H #include "Mixer.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "AutomatableModel.h" class bbTrack; class pattern; -class sampleTCO; +class SampleTCO; class track; class AudioPort; -class samplePlayHandle : public playHandle +class SamplePlayHandle : public playHandle { public: - samplePlayHandle( const QString & _sample_file ); - samplePlayHandle( sampleBuffer * _sample_buffer ); - samplePlayHandle( sampleTCO * _tco ); - samplePlayHandle( pattern * _pattern ); - virtual ~samplePlayHandle(); + SamplePlayHandle( const QString& sampleFile ); + SamplePlayHandle( SampleBuffer* sampleBuffer ); + SamplePlayHandle( SampleTCO* tco ); + SamplePlayHandle( pattern * _pattern ); + virtual ~SamplePlayHandle(); virtual inline bool affinityMatters() const { @@ -79,11 +78,11 @@ public: private: - sampleBuffer * m_sampleBuffer; + SampleBuffer * m_sampleBuffer; bool m_doneMayReturnTrue; f_cnt_t m_frame; - sampleBuffer::handleState m_state; + SampleBuffer::handleState m_state; AudioPort * m_audioPort; const bool m_ownAudioPort; diff --git a/include/sample_record_handle.h b/include/SampleRecordHandle.h similarity index 83% rename from include/sample_record_handle.h rename to include/SampleRecordHandle.h index 5afeb08f8..465005fbe 100644 --- a/include/sample_record_handle.h +++ b/include/SampleRecordHandle.h @@ -1,5 +1,5 @@ /* - * sample_record_handle.h - play-handle for recording a sample + * SampleRecordHandle.h - play-handle for recording a sample * * Copyright (c) 2008 Csaba Hruska * @@ -31,19 +31,19 @@ #include #include "Mixer.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" class bbTrack; class pattern; -class sampleTCO; +class SampleTCO; class track; -class sampleRecordHandle : public playHandle +class SampleRecordHandle : public playHandle { public: - sampleRecordHandle( sampleTCO * _tco ); - virtual ~sampleRecordHandle(); + SampleRecordHandle( SampleTCO* tco ); + virtual ~SampleRecordHandle(); virtual void play( sampleFrame * _working_buffer ); virtual bool done() const; @@ -51,7 +51,7 @@ public: virtual bool isFromTrack( const track * _track ) const; f_cnt_t framesRecorded() const; - void createSampleBuffer( sampleBuffer * * _sample_buf ); + void createSampleBuffer( SampleBuffer * * _sample_buf ); private: @@ -65,7 +65,7 @@ private: track * m_track; bbTrack * m_bbTrack; - sampleTCO * m_tco; + SampleTCO * m_tco; } ; diff --git a/include/sample_track.h b/include/SampleTrack.h similarity index 76% rename from include/sample_track.h rename to include/SampleTrack.h index ca799c101..7733d4dce 100644 --- a/include/sample_track.h +++ b/include/SampleTrack.h @@ -1,8 +1,7 @@ /* - * sample_track.h - class sampleTrack, a track which provides arrangement of - * samples + * SampleTrack.h - class SampleTrack, a track which provides arrangement of samples * - * Copyright (c) 2005-2010 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,16 +32,16 @@ class EffectRackView; class knob; -class sampleBuffer; +class SampleBuffer; -class sampleTCO : public trackContentObject +class SampleTCO : public trackContentObject { Q_OBJECT mapPropertyFromModel(bool,isRecord,setRecord,m_recordModel); public: - sampleTCO( track * _track ); - virtual ~sampleTCO(); + SampleTCO( track * _track ); + virtual ~SampleTCO(); virtual void changeLength( const midiTime & _length ); const QString & sampleFile() const; @@ -54,7 +53,7 @@ public: return "sampletco"; } - sampleBuffer * getSampleBuffer() + SampleBuffer* sampleBuffer() { return m_sampleBuffer; } @@ -65,18 +64,18 @@ public: public slots: - void setSampleBuffer( sampleBuffer * _sb ); + void setSampleBuffer( SampleBuffer* sb ); void setSampleFile( const QString & _sf ); void updateLength( bpm_t = 0 ); void toggleRecord(); private: - sampleBuffer * m_sampleBuffer; + SampleBuffer* m_sampleBuffer; BoolModel m_recordModel; - friend class sampleTCOView; + friend class SampleTCOView; signals: @@ -86,12 +85,12 @@ signals: -class sampleTCOView : public trackContentObjectView +class SampleTCOView : public trackContentObjectView { Q_OBJECT public: - sampleTCOView( sampleTCO * _tco, trackView * _tv ); - virtual ~sampleTCOView(); + SampleTCOView( SampleTCO * _tco, trackView * _tv ); + virtual ~SampleTCOView(); public slots: @@ -108,24 +107,24 @@ protected: private: - sampleTCO * m_tco; + SampleTCO * m_tco; } ; -class sampleTrack : public track +class SampleTrack : public track { Q_OBJECT public: - sampleTrack( trackContainer * _tc ); - virtual ~sampleTrack(); + SampleTrack( TrackContainer* tc ); + virtual ~SampleTrack(); virtual bool play( const midiTime & _start, const fpp_t _frames, const f_cnt_t _frame_base, Sint16 _tco_num = -1 ); - virtual trackView * createView( trackContainerView * _tcv ); + virtual trackView * createView( TrackContainerView* tcv ); virtual trackContentObject * createTCO( const midiTime & _pos ); @@ -149,18 +148,18 @@ private: FloatModel m_volumeModel; - friend class sampleTrackView; + friend class SampleTrackView; } ; -class sampleTrackView : public trackView +class SampleTrackView : public trackView { Q_OBJECT public: - sampleTrackView( sampleTrack * _track, trackContainerView * _tcv ); - virtual ~sampleTrackView(); + SampleTrackView( SampleTrack* track, TrackContainerView* tcv ); + virtual ~SampleTrackView(); public slots: diff --git a/include/track_container.h b/include/TrackContainer.h similarity index 83% rename from include/track_container.h rename to include/TrackContainer.h index 82c41464b..5918c59ea 100644 --- a/include/track_container.h +++ b/include/TrackContainer.h @@ -1,6 +1,6 @@ /* - * track_container.h - base-class for all track-containers like Song-Editor, - * BB-Editor... + * TrackContainer.h - base-class for all track-containers like Song-Editor, + * BB-Editor... * * Copyright (c) 2004-2009 Tobias Doerffel * @@ -34,17 +34,17 @@ class AutomationPattern; class InstrumentTrack; -class trackContainerView; +class TrackContainerView; -class EXPORT trackContainer : public Model, public JournallingObject +class EXPORT TrackContainer : public Model, public JournallingObject { Q_OBJECT public: - typedef QVector trackList; + typedef QVector TrackList; - trackContainer(); - virtual ~trackContainer(); + TrackContainer(); + virtual ~TrackContainer(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); @@ -66,7 +66,7 @@ public: void clearAllTracks(); - const trackList & tracks() const + const TrackList & tracks() const { return m_tracks; } @@ -86,16 +86,16 @@ protected: mutable QReadWriteLock m_tracksMutex; private: - trackList m_tracks; + TrackList m_tracks; - friend class trackContainerView; + friend class TrackContainerView; friend class track; } ; -class DummyTrackContainer : public trackContainer +class DummyTrackContainer : public TrackContainer { public: DummyTrackContainer(); diff --git a/include/track_container_view.h b/include/TrackContainerView.h similarity index 87% rename from include/track_container_view.h rename to include/TrackContainerView.h index cace6bf8e..2203fb868 100644 --- a/include/track_container_view.h +++ b/include/TrackContainerView.h @@ -1,7 +1,7 @@ /* - * track_container_view.h - view-component for trackContainer + * TrackContainerView.h - view-component for TrackContainer * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -36,17 +36,17 @@ class QVBoxLayout; -class trackContainer; +class TrackContainer; -class trackContainerView : public QWidget, public ModelView, +class TrackContainerView : public QWidget, public ModelView, public JournallingObject, public SerializingObjectHook { Q_OBJECT public: - trackContainerView( trackContainer * _tc ); - virtual ~trackContainerView(); + TrackContainerView( TrackContainer* tc ); + virtual ~TrackContainerView(); virtual void saveSettings( QDomDocument & _doc, QDomElement & _this ); virtual void loadSettings( const QDomElement & _this ); @@ -92,14 +92,14 @@ public: } - trackContainer * model() + TrackContainer* model() { - return( m_tc ); + return m_tc; } - const trackContainer * model() const + const TrackContainer* model() const { - return( m_tc ); + return m_tc; } void moveTrackViewUp( trackView * _tv ); @@ -155,18 +155,18 @@ private: class scrollArea : public QScrollArea { public: - scrollArea( trackContainerView * _parent ); + scrollArea( TrackContainerView* parent ); virtual ~scrollArea(); protected: virtual void wheelEvent( QWheelEvent * _we ); private: - trackContainerView * m_trackContainerView; + TrackContainerView* m_trackContainerView; } ; - trackContainer * m_tc; + TrackContainer* m_tc; typedef QList trackViewList; trackViewList m_trackViews; diff --git a/include/bb_editor.h b/include/bb_editor.h index b7a91a704..200896718 100644 --- a/include/bb_editor.h +++ b/include/bb_editor.h @@ -1,7 +1,7 @@ /* * bb_editor.h - view-component of BB-Editor * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,7 +26,7 @@ #ifndef _BB_EDITOR_H #define _BB_EDITOR_H -#include "track_container_view.h" +#include "TrackContainerView.h" class bbTrackContainer; @@ -34,7 +34,7 @@ class comboBox; class toolButton; -class bbEditor : public trackContainerView +class bbEditor : public TrackContainerView { Q_OBJECT public: diff --git a/include/bb_track.h b/include/bb_track.h index d64c8e35b..020a59df9 100644 --- a/include/bb_track.h +++ b/include/bb_track.h @@ -2,7 +2,7 @@ * bb_track.h - class bbTrack, a wrapper for using bbEditor * (which is a singleton-class) as track * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,7 +33,7 @@ #include "track.h" class trackLabelButton; -class trackContainer; +class TrackContainer; class bbTCO : public trackContentObject @@ -106,14 +106,14 @@ class EXPORT bbTrack : public track { Q_OBJECT public: - bbTrack( trackContainer * _tc ); + bbTrack( TrackContainer* tc ); virtual ~bbTrack(); virtual bool play( const midiTime & _start, const fpp_t _frames, const f_cnt_t _frame_base, Sint16 _tco_num = -1 ); - virtual trackView * createView( trackContainerView * _tcv ); + virtual trackView * createView( TrackContainerView* tcv ); virtual trackContentObject * createTCO( const midiTime & _pos ); virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -162,7 +162,7 @@ class bbTrackView : public trackView { Q_OBJECT public: - bbTrackView( bbTrack * _bbt, trackContainerView * _tcv ); + bbTrackView( bbTrack* bbt, TrackContainerView* tcv ); virtual ~bbTrackView(); virtual bool close(); diff --git a/include/bb_track_container.h b/include/bb_track_container.h index e600a3cd6..84d06f1fd 100644 --- a/include/bb_track_container.h +++ b/include/bb_track_container.h @@ -1,7 +1,7 @@ /* * bb_track_container.h - model-component of BB-Editor * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -26,11 +26,11 @@ #ifndef _BB_TRACK_CONTAINER_H #define _BB_TRACK_CONTAINER_H -#include "track_container.h" +#include "TrackContainer.h" #include "combobox.h" -class EXPORT bbTrackContainer : public trackContainer +class EXPORT bbTrackContainer : public TrackContainer { Q_OBJECT mapPropertyFromModel(int,currentBB,setCurrentBB,m_bbComboBoxModel); diff --git a/include/file_browser.h b/include/file_browser.h index 3830f6eed..6420ca3fe 100644 --- a/include/file_browser.h +++ b/include/file_browser.h @@ -1,7 +1,7 @@ /* * file_browser.h - include file for fileBrowser * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -40,7 +40,7 @@ class fileItem; class InstrumentTrack; class fileBrowserTreeWidget; class playHandle; -class trackContainer; +class TrackContainer; @@ -96,7 +96,7 @@ protected: private: void handleFile( fileItem * _fi, InstrumentTrack * _it ); - void openInNewInstrumentTrack( trackContainer * _tc ); + void openInNewInstrumentTrack( TrackContainer* tc ); bool m_mousePressed; diff --git a/include/pattern.h b/include/pattern.h index 4f8b9953f..2c937eaca 100644 --- a/include/pattern.h +++ b/include/pattern.h @@ -2,7 +2,7 @@ * pattern.h - declaration of class pattern, which contains all informations * about a pattern * - * Copyright (c) 2004-2011 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -43,7 +43,7 @@ class QPushButton; class InstrumentTrack; class patternFreezeThread; -class sampleBuffer; +class SampleBuffer; @@ -104,7 +104,7 @@ public: return m_frozenPattern != NULL; } - sampleBuffer *frozenPattern() + SampleBuffer *frozenPattern() { return m_frozenPattern; } @@ -157,7 +157,7 @@ private: int m_steps; // pattern freezing - sampleBuffer * m_frozenPattern; + SampleBuffer* m_frozenPattern; bool m_freezing; volatile bool m_freezeAborted; diff --git a/include/setup_dialog.h b/include/setup_dialog.h index 4bac5e0fe..82f66eae8 100644 --- a/include/setup_dialog.h +++ b/include/setup_dialog.h @@ -110,6 +110,7 @@ private slots: void toggleCompactTrackButtons( bool _enabled ); void toggleSyncVSTPlugins( bool _enabled ); void toggleAnimateAFP( bool _enabled ); + void toggleNoteLabels( bool en ); private: @@ -160,6 +161,7 @@ private: bool m_compactTrackButtons; bool m_syncVSTPlugins; bool m_animateAFP; + bool m_printNoteLabels; typedef QMap AswMap; typedef QMap MswMap; diff --git a/include/song.h b/include/song.h index 6cc671cda..ed6c18872 100644 --- a/include/song.h +++ b/include/song.h @@ -28,7 +28,7 @@ #include #include -#include "track_container.h" +#include "TrackContainer.h" #include "AutomatableModel.h" #include "Controller.h" #include "MeterModel.h" @@ -45,7 +45,7 @@ const bpm_t MaxTempo = 999; const tick_t MaxSongLength = 9999 * DefaultTicksPerTact; -class EXPORT song : public trackContainer +class EXPORT song : public TrackContainer { Q_OBJECT mapPropertyFromModel(int,getTempo,setTempo,m_tempoModel); diff --git a/include/song_editor.h b/include/song_editor.h index f69530af3..989636790 100644 --- a/include/song_editor.h +++ b/include/song_editor.h @@ -2,7 +2,7 @@ * song_editor.h - declaration of class songEditor, a window where you can * setup your songs * - * Copyright (c) 2004-2011 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,7 +27,7 @@ #ifndef _SONG_EDITOR_H #define _SONG_EDITOR_H -#include "track_container_view.h" +#include "TrackContainerView.h" class QLabel; class QScrollBar; @@ -52,7 +52,7 @@ private: } ; -class songEditor : public trackContainerView +class songEditor : public TrackContainerView { Q_OBJECT public: diff --git a/include/track.h b/include/track.h index 1011c245d..e89e385ac 100644 --- a/include/track.h +++ b/include/track.h @@ -45,8 +45,8 @@ class pixmapButton; class textFloat; class track; class trackContentObjectView; -class trackContainer; -class trackContainerView; +class TrackContainer; +class TrackContainerView; class trackContentWidget; class trackView; @@ -364,12 +364,12 @@ public: NumTrackTypes } ; - track( TrackTypes _type, trackContainer * _tc ); + track( TrackTypes _type, TrackContainer * _tc ); virtual ~track(); - static track * create( TrackTypes _tt, trackContainer * _tc ); + static track * create( TrackTypes _tt, TrackContainer * _tc ); static track * create( const QDomElement & _this, - trackContainer * _tc ); + TrackContainer * _tc ); void clone(); @@ -384,7 +384,7 @@ public: Sint16 _tco_num = -1 ) = 0; - virtual trackView * createView( trackContainerView * _view ) = 0; + virtual trackView * createView( TrackContainerView * _view ) = 0; virtual trackContentObject * createTCO( const midiTime & _pos ) = 0; virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -424,9 +424,9 @@ public: tact_t length() const; - inline trackContainer * getTrackContainer() const + inline TrackContainer* trackContainer() const { - return( m_trackContainer ); + return m_trackContainer; } // name-stuff @@ -461,7 +461,7 @@ public slots: private: - trackContainer * m_trackContainer; + TrackContainer* m_trackContainer; TrackTypes m_type; QString m_name; int m_height; @@ -492,7 +492,7 @@ class trackView : public QWidget, public ModelView, public JournallingObject { Q_OBJECT public: - trackView( track * _track, trackContainerView * _tcv ); + trackView( track * _track, TrackContainerView* tcv ); virtual ~trackView(); inline const track * getTrack() const @@ -505,9 +505,9 @@ public: return( m_track ); } - inline trackContainerView * getTrackContainerView() + inline TrackContainerView* trackContainerView() { - return( m_trackContainerView ); + return m_trackContainerView; } inline trackOperationsWidget * getTrackOperationsWidget() @@ -566,7 +566,7 @@ private: } ; track * m_track; - trackContainerView * m_trackContainerView; + TrackContainerView * m_trackContainerView; trackOperationsWidget m_trackOperationsWidget; trackSettingsWidget m_trackSettingsWidget; diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 6390e4834..800c5ba6d 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -378,7 +378,7 @@ bool HydrogenImport::readSong() } return true; } -bool HydrogenImport::tryImport( trackContainer * _tc ) +bool HydrogenImport::tryImport( TrackContainer* tc ) { if( openFile() == false ) { diff --git a/plugins/HydrogenImport/HydrogenImport.h b/plugins/HydrogenImport/HydrogenImport.h index 10a1cba7c..6fe8e3c4c 100644 --- a/plugins/HydrogenImport/HydrogenImport.h +++ b/plugins/HydrogenImport/HydrogenImport.h @@ -21,7 +21,7 @@ public: return( NULL ); } private: - virtual bool tryImport( trackContainer * _tc ); + virtual bool tryImport( TrackContainer* tc ); }; #endif diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index 76f619dd3..41ad894f4 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -1,7 +1,7 @@ /* * audio_file_processor.cpp - instrument for using audio-files * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -510,9 +510,9 @@ void AudioFileProcessorView::modelChanged( void ) -AudioFileProcessorWaveView::AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, sampleBuffer & _buf ) : +AudioFileProcessorWaveView::AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, SampleBuffer& buf ) : QWidget( _parent ), - m_sampleBuffer( _buf ), + m_sampleBuffer( buf ), m_graph( QPixmap( _w - 2 * s_padding, _h - 2 * s_padding ) ), m_from( 0 ), m_to( m_sampleBuffer.frames() ), diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index cdcbbd46a..2372f970a 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -2,7 +2,7 @@ * audio_file_processor.h - declaration of class audioFileProcessor * (instrument-plugin for using audio-files) * - * Copyright (c) 2004-2008 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,7 +31,7 @@ #include "Instrument.h" #include "InstrumentView.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "knob.h" #include "pixmap_button.h" @@ -81,9 +81,9 @@ signals: private: - typedef sampleBuffer::handleState handleState; + typedef SampleBuffer::handleState handleState; - sampleBuffer m_sampleBuffer; + SampleBuffer m_sampleBuffer; FloatModel m_ampModel; FloatModel m_startPointModel; @@ -219,7 +219,7 @@ private: sample_end, } ; - sampleBuffer & m_sampleBuffer; + SampleBuffer& m_sampleBuffer; QPixmap m_graph; f_cnt_t m_from; f_cnt_t m_to; @@ -237,7 +237,7 @@ private: bool m_animation; public: - AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, sampleBuffer & _buf ); + AudioFileProcessorWaveView( QWidget * _parent, int _w, int _h, SampleBuffer& buf ); void setKnobs( knob * _start, knob * _end ); diff --git a/plugins/flp_import/FlpImport.cpp b/plugins/flp_import/FlpImport.cpp index a61daef64..a92820423 100644 --- a/plugins/flp_import/FlpImport.cpp +++ b/plugins/flp_import/FlpImport.cpp @@ -1,7 +1,7 @@ /* * flp_import.cpp - support for importing FLP-files * - * Copyright (c) 2006-2009 Tobias Doerffel + * Copyright (c) 2006-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -53,7 +53,7 @@ #include "ProjectJournal.h" #include "project_notes.h" #include "song.h" -#include "track_container.h" +#include "TrackContainer.h" #include "embed.h" #include "lmmsconfig.h" @@ -588,7 +588,7 @@ FlpImport::~FlpImport() -bool FlpImport::tryImport( trackContainer * _tc ) +bool FlpImport::tryImport( TrackContainer* tc ) { const int mappedFilter[] = { @@ -713,9 +713,9 @@ bool FlpImport::tryImport( trackContainer * _tc ) } QProgressDialog progressDialog( - trackContainer::tr( "Importing FLP-file..." ), - trackContainer::tr( "Cancel" ), 0, p.numChannels ); - progressDialog.setWindowTitle( trackContainer::tr( "Please wait..." ) ); + TrackContainer::tr( "Importing FLP-file..." ), + TrackContainer::tr( "Cancel" ), 0, p.numChannels ); + progressDialog.setWindowTitle( TrackContainer::tr( "Please wait..." ) ); progressDialog.show(); bool valid = false; diff --git a/plugins/flp_import/FlpImport.h b/plugins/flp_import/FlpImport.h index e096f1301..df4be18d4 100644 --- a/plugins/flp_import/FlpImport.h +++ b/plugins/flp_import/FlpImport.h @@ -1,7 +1,7 @@ /* * FlpImport.h - support for importing FLP-files * - * Copyright (c) 2006-2009 Tobias Doerffel + * Copyright (c) 2006-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -50,7 +50,7 @@ public: private: - virtual bool tryImport( trackContainer * _tc ); + virtual bool tryImport( TrackContainer* tc ); void processPluginParams( FL_Channel * _ch ); diff --git a/plugins/midi_import/MidiImport.cpp b/plugins/midi_import/MidiImport.cpp index f69fa4b48..585c2f5eb 100644 --- a/plugins/midi_import/MidiImport.cpp +++ b/plugins/midi_import/MidiImport.cpp @@ -1,7 +1,7 @@ /* * MidiImport.cpp - support for importing MIDI files * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -30,7 +30,7 @@ #include #include "MidiImport.h" -#include "track_container.h" +#include "TrackContainer.h" #include "InstrumentTrack.h" #include "AutomationTrack.h" #include "AutomationPattern.h" @@ -87,7 +87,7 @@ MidiImport::~MidiImport() -bool MidiImport::tryImport( trackContainer * _tc ) +bool MidiImport::tryImport( TrackContainer* tc ) { if( openFile() == false ) { @@ -124,11 +124,11 @@ bool MidiImport::tryImport( trackContainer * _tc ) { case makeID( 'M', 'T', 'h', 'd' ): printf( "MidiImport::tryImport(): found MThd\n"); - return readSMF( _tc ); + return readSMF( tc ); case makeID( 'R', 'I', 'F', 'F' ): printf( "MidiImport::tryImport(): found RIFF\n"); - return readRIFF( _tc ); + return readRIFF( tc ); default: printf( "MidiImport::tryImport(): not a Standard MIDI " @@ -154,12 +154,11 @@ public: AutomationPattern * ap; midiTime lastPos; - smfMidiCC & create( trackContainer * _tc ) + smfMidiCC & create( TrackContainer* tc ) { if( !at ) { - at = dynamic_cast( - track::create( track::AutomationTrack, _tc ) ); + at = dynamic_cast( track::create( track::AutomationTrack, tc ) ); } return *this; } @@ -215,11 +214,10 @@ public: bool hasNotes; midiTime lastEnd; - smfMidiChannel * create( trackContainer * _tc ) + smfMidiChannel * create( TrackContainer* tc ) { if( !it ) { - it = dynamic_cast( - track::create( track::InstrumentTrack, _tc ) ); + it = dynamic_cast( track::create( track::InstrumentTrack, tc ) ); #ifdef LMMS_HAVE_FLUIDSYNTH it_inst = it->loadInstrument( "sf2player" ); @@ -262,15 +260,15 @@ public: }; -bool MidiImport::readSMF( trackContainer * _tc ) +bool MidiImport::readSMF( TrackContainer* tc ) { QString filename = file().fileName(); closeFile(); const int preTrackSteps = 2; - QProgressDialog pd( trackContainer::tr( "Importing MIDI-file..." ), - trackContainer::tr( "Cancel" ), 0, preTrackSteps, engine::mainWindow() ); - pd.setWindowTitle( trackContainer::tr( "Please wait..." ) ); + QProgressDialog pd( TrackContainer::tr( "Importing MIDI-file..." ), + TrackContainer::tr( "Cancel" ), 0, preTrackSteps, engine::mainWindow() ); + pd.setWindowTitle( TrackContainer::tr( "Please wait..." ) ); pd.setWindowModality(Qt::WindowModal); pd.setMinimumDuration( 0 ); @@ -318,7 +316,7 @@ bool MidiImport::readSMF( trackContainer * _tc ) pd.setValue( 2 ); // Tempo stuff - AutomationPattern * tap = _tc->tempoAutomationPattern(); + AutomationPattern * tap = tc->tempoAutomationPattern(); if( tap ) { tap->clear(); @@ -376,7 +374,7 @@ bool MidiImport::readSMF( trackContainer * _tc ) } else if( evt->is_note() && evt->chan < 256 ) { - smfMidiChannel * ch = chs[evt->chan].create( _tc ); + smfMidiChannel * ch = chs[evt->chan].create( tc ); Alg_note_ptr noteEvt = dynamic_cast( evt ); note n( noteEvt->get_duration() * ticksPerBeat, @@ -389,7 +387,7 @@ bool MidiImport::readSMF( trackContainer * _tc ) else if( evt->is_update() ) { - smfMidiChannel * ch = chs[evt->chan].create( _tc ); + smfMidiChannel * ch = chs[evt->chan].create( tc ); double time = evt->time*ticksPerBeat; QString update( evt->get_attribute() ); @@ -469,7 +467,7 @@ bool MidiImport::readSMF( trackContainer * _tc ) } else { - ccs[ccid].create( _tc ); + ccs[ccid].create( tc ); ccs[ccid].putValue( time, objModel, cc ); } } @@ -492,7 +490,7 @@ bool MidiImport::readSMF( trackContainer * _tc ) { printf(" Should remove empty track\n"); // must delete trackView first - but where is it? - //_tc->removeTrack( chs[c].it ); + //tc->removeTrack( chs[c].it ); //it->deleteLater(); } } @@ -503,7 +501,7 @@ bool MidiImport::readSMF( trackContainer * _tc ) -bool MidiImport::readRIFF( trackContainer * _tc ) +bool MidiImport::readRIFF( TrackContainer* tc ) { // skip file length skip( 4 ); @@ -543,7 +541,7 @@ data_not_found: { goto invalid_format; } - return readSMF( _tc ); + return readSMF( tc ); } diff --git a/plugins/midi_import/MidiImport.h b/plugins/midi_import/MidiImport.h index a6dd4dce2..e1d5bc947 100644 --- a/plugins/midi_import/MidiImport.h +++ b/plugins/midi_import/MidiImport.h @@ -1,7 +1,7 @@ /* * MidiImport.h - support for importing MIDI-files * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -46,10 +46,10 @@ public: private: - virtual bool tryImport( trackContainer * _tc ); + virtual bool tryImport( TrackContainer* tc ); - bool readSMF( trackContainer * _tc ); - bool readRIFF( trackContainer * _tc ); + bool readSMF( TrackContainer* tc ); + bool readRIFF( TrackContainer* tc ); bool readTrack( int _track_end, QString & _track_name ); void error( void ); diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 85457871f..269eb00f3 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -192,9 +192,8 @@ void patmanInstrument::setFile( const QString & _patch_file, bool _rename ) // else we don't touch the instrument-track-name, because the user // named it self - m_patchFile = sampleBuffer::tryToMakeRelative( _patch_file ); - LoadErrors error = loadPatch( sampleBuffer::tryToMakeAbsolute( - _patch_file ) ); + m_patchFile = SampleBuffer::tryToMakeRelative( _patch_file ); + LoadErrors error = loadPatch( SampleBuffer::tryToMakeAbsolute( _patch_file ) ); if( error ) { printf("Load error\n"); @@ -351,7 +350,7 @@ patmanInstrument::LoadErrors patmanInstrument::loadPatch( } } - sampleBuffer * psample = new sampleBuffer( data, frames ); + SampleBuffer* psample = new SampleBuffer( data, frames ); psample->setFrequency( root_freq / 1000.0f ); psample->setSampleRate( sample_rate ); @@ -390,10 +389,9 @@ void patmanInstrument::selectSample( notePlayHandle * _n ) const float freq = _n->frequency(); float min_dist = HUGE_VALF; - sampleBuffer * sample = NULL; + SampleBuffer* sample = NULL; - for( QVector::iterator it = m_patchSamples.begin(); - it != m_patchSamples.end(); ++it ) + for( QVector::iterator it = m_patchSamples.begin(); it != m_patchSamples.end(); ++it ) { float patch_freq = ( *it )->frequency(); float dist = freq >= patch_freq ? freq / patch_freq : @@ -414,9 +412,9 @@ void patmanInstrument::selectSample( notePlayHandle * _n ) } else { - hdata->sample = new sampleBuffer( NULL, 0 ); + hdata->sample = new SampleBuffer( NULL, 0 ); } - hdata->state = new sampleBuffer::handleState( _n->hasDetuningInfo() ); + hdata->state = new SampleBuffer::handleState( _n->hasDetuningInfo() ); _n->m_pluginData = hdata; } diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 78c0d1ca4..046ac41dd 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -28,7 +28,7 @@ #include "Instrument.h" #include "InstrumentView.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "AutomatableModel.h" @@ -79,13 +79,13 @@ public slots: private: typedef struct { - sampleBuffer::handleState * state; + SampleBuffer::handleState* state; bool tuned; - sampleBuffer * sample; + SampleBuffer* sample; } handle_data; QString m_patchFile; - QVector m_patchSamples; + QVector m_patchSamples; BoolModel m_loopedModel; BoolModel m_tunedModel; diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index e25883785..69d3dd632 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -2,7 +2,7 @@ * sf2_player.cpp - a soundfont2 player using fluidSynth * * Copyright (c) 2008 Paul Giblock - * Copyright (c) 2009-2013 Tobias Doerffel + * Copyright (c) 2009-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -334,9 +334,8 @@ void sf2Instrument::openFile( const QString & _sf2File, bool updateTrackName ) emit fileLoading(); // Used for loading file - char * sf2Ascii = qstrdup( qPrintable( - sampleBuffer::tryToMakeAbsolute( _sf2File ) ) ); - QString relativePath = sampleBuffer::tryToMakeRelative( _sf2File ); + char * sf2Ascii = qstrdup( qPrintable( SampleBuffer::tryToMakeAbsolute( _sf2File ) ) ); + QString relativePath = SampleBuffer::tryToMakeRelative( _sf2File ); // free reference to soundfont if one is selected freeFont(); diff --git a/plugins/sf2_player/sf2_player.h b/plugins/sf2_player/sf2_player.h index 9c7412bc1..903480605 100644 --- a/plugins/sf2_player/sf2_player.h +++ b/plugins/sf2_player/sf2_player.h @@ -36,7 +36,7 @@ #include "lcd_spinbox.h" #include "led_checkbox.h" #include "fluidsynth.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" class sf2InstrumentView; class sf2Font; diff --git a/plugins/triple_oscillator/TripleOscillator.cpp b/plugins/triple_oscillator/TripleOscillator.cpp index e928aa539..37146c1ff 100644 --- a/plugins/triple_oscillator/TripleOscillator.cpp +++ b/plugins/triple_oscillator/TripleOscillator.cpp @@ -1,7 +1,7 @@ /* * TripleOscillator.cpp - powerful instrument with three oscillators * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -35,7 +35,7 @@ #include "knob.h" #include "note_play_handle.h" #include "pixmap_button.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "song_editor.h" #include "tooltip.h" @@ -88,7 +88,7 @@ OscillatorObject::OscillatorObject( Model * _parent, int _idx ) : Oscillator::NumModulationAlgos-1, this, tr( "Modulation type %1" ).arg( _idx+1 ) ), - m_sampleBuffer( new sampleBuffer ), + m_sampleBuffer( new SampleBuffer ), m_volumeLeft( 0.0f ), m_volumeRight( 0.0f ), m_detuningLeft( 0.0f ), diff --git a/plugins/triple_oscillator/TripleOscillator.h b/plugins/triple_oscillator/TripleOscillator.h index 4d95f16d9..3fa24c9d6 100644 --- a/plugins/triple_oscillator/TripleOscillator.h +++ b/plugins/triple_oscillator/TripleOscillator.h @@ -2,7 +2,7 @@ * TripleOscillator.h - declaration of class TripleOscillator a powerful * instrument-plugin with 3 oscillators * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -36,7 +36,7 @@ class automatableButtonGroup; class knob; class notePlayHandle; class pixmapButton; -class sampleBuffer; +class SampleBuffer; const int NUM_OF_OSCILLATORS = 3; @@ -59,7 +59,7 @@ private: FloatModel m_stereoPhaseDetuningModel; IntModel m_waveShapeModel; IntModel m_modulationAlgoModel; - sampleBuffer * m_sampleBuffer; + SampleBuffer* m_sampleBuffer; float m_volumeLeft; float m_volumeRight; diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index 4d315400b..91ecb27b8 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -26,7 +26,6 @@ #include "Instrument.h" #include "InstrumentView.h" -#include "sample_buffer.h" #include "graph.h" #include "knob.h" #include "pixmap_button.h" diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index a29ee0025..25f4114b8 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -2,7 +2,7 @@ * AutomationPattern.cpp - implementation of class AutomationPattern which * holds dynamic values * - * Copyright (c) 2008-2013 Tobias Doerffel + * Copyright (c) 2008-2014 Tobias Doerffel * Copyright (c) 2006-2008 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -449,10 +449,10 @@ trackContentObjectView * AutomationPattern::createView( trackView * _tv ) bool AutomationPattern::isAutomated( const AutomatableModel * _m ) { - trackContainer::trackList l = engine::getSong()->tracks() + + TrackContainer::TrackList l = engine::getSong()->tracks() + engine::getBBTrackContainer()->tracks(); l += engine::getSong()->globalAutomationTrack(); - for( trackContainer::trackList::const_iterator it = l.begin(); + for( TrackContainer::TrackList::const_iterator it = l.begin(); it != l.end(); ++it ) { if( ( *it )->type() == track::AutomationTrack || @@ -516,10 +516,10 @@ AutomationPattern * AutomationPattern::globalAutomationPattern( void AutomationPattern::resolveAllIDs() { - trackContainer::trackList l = engine::getSong()->tracks() + + TrackContainer::TrackList l = engine::getSong()->tracks() + engine::getBBTrackContainer()->tracks(); l += engine::getSong()->globalAutomationTrack(); - for( trackContainer::trackList::iterator it = l.begin(); + for( TrackContainer::TrackList::iterator it = l.begin(); it != l.end(); ++it ) { if( ( *it )->type() == track::AutomationTrack || diff --git a/src/core/ImportFilter.cpp b/src/core/ImportFilter.cpp index 04795afe1..e32149df8 100644 --- a/src/core/ImportFilter.cpp +++ b/src/core/ImportFilter.cpp @@ -1,7 +1,7 @@ /* * ImportFilter.cpp - base-class for all import-filters (MIDI, FLP etc) * - * Copyright (c) 2006-2009 Tobias Doerffel + * Copyright (c) 2006-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -27,7 +27,7 @@ #include "ImportFilter.h" #include "engine.h" -#include "track_container.h" +#include "TrackContainer.h" #include "ProjectJournal.h" @@ -50,7 +50,7 @@ ImportFilter::~ImportFilter() void ImportFilter::import( const QString & _file_to_import, - trackContainer * _tc ) + TrackContainer* tc ) { DescriptorList d; Plugin::getDescriptorsOfAvailPlugins( d ); @@ -70,8 +70,7 @@ void ImportFilter::import( const QString & _file_to_import, { Plugin * p = Plugin::instantiate( it->name, NULL, s ); if( dynamic_cast( p ) != NULL && - dynamic_cast( p )->tryImport( - _tc ) == true ) + dynamic_cast( p )->tryImport( tc ) == true ) { delete p; successful = true; @@ -88,8 +87,8 @@ void ImportFilter::import( const QString & _file_to_import, if( successful == false ) { QMessageBox::information( NULL, - trackContainer::tr( "Couldn't import file" ), - trackContainer::tr( "Couldn't find a filter for " + TrackContainer::tr( "Couldn't import file" ), + TrackContainer::tr( "Couldn't find a filter for " "importing file %1.\n" "You should convert this file " "into a format supported by " @@ -108,8 +107,8 @@ bool ImportFilter::openFile() if( m_file.open( QFile::ReadOnly ) == false ) { QMessageBox::critical( NULL, - trackContainer::tr( "Couldn't open file" ), - trackContainer::tr( "Couldn't open file %1 " + TrackContainer::tr( "Couldn't open file" ), + TrackContainer::tr( "Couldn't open file %1 " "for reading.\nPlease make " "sure you have read-" "permission to the file and " diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 9440767e4..ab0ac4048 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -37,7 +37,7 @@ #include "debug.h" #include "engine.h" #include "config_mgr.h" -#include "sample_play_handle.h" +#include "SamplePlayHandle.h" #include "piano_roll.h" #include "MicroTimer.h" #include "atomic_int.h" @@ -354,7 +354,7 @@ const surroundSampleFrame * Mixer::renderNextBuffer() p != last_metro_pos && p.getTicks() % (DefaultTicksPerTact / 4 ) == 0 ) { - addPlayHandle( new samplePlayHandle( "misc/metronome01.ogg" ) ); + addPlayHandle( new SamplePlayHandle( "misc/metronome01.ogg" ) ); last_metro_pos = p; } diff --git a/src/core/sample_buffer.cpp b/src/core/SampleBuffer.cpp similarity index 82% rename from src/core/sample_buffer.cpp rename to src/core/SampleBuffer.cpp index 45483eae7..3308faf60 100644 --- a/src/core/sample_buffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -1,7 +1,7 @@ /* - * sample_buffer.cpp - container-class sampleBuffer + * SampleBuffer.cpp - container-class SampleBuffer * - * Copyright (c) 2005-2013 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -23,7 +23,7 @@ */ -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "Mixer.h" @@ -62,7 +62,7 @@ #include "templates.h" -sampleBuffer::sampleBuffer( const QString & _audio_file, +SampleBuffer::SampleBuffer( const QString & _audio_file, bool _is_base64_data ) : m_audioFile( ( _is_base64_data == true ) ? "" : _audio_file ), m_origData( NULL ), @@ -88,7 +88,7 @@ sampleBuffer::sampleBuffer( const QString & _audio_file, -sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) : +SampleBuffer::SampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) : m_audioFile( "" ), m_origData( NULL ), m_origFrames( 0 ), @@ -115,7 +115,7 @@ sampleBuffer::sampleBuffer( const sampleFrame * _data, const f_cnt_t _frames ) : -sampleBuffer::sampleBuffer( const f_cnt_t _frames ) : +SampleBuffer::SampleBuffer( const f_cnt_t _frames ) : m_audioFile( "" ), m_origData( NULL ), m_origFrames( 0 ), @@ -142,7 +142,7 @@ sampleBuffer::sampleBuffer( const f_cnt_t _frames ) : -sampleBuffer::~sampleBuffer() +SampleBuffer::~SampleBuffer() { delete[] m_origData; delete[] m_data; @@ -153,7 +153,7 @@ sampleBuffer::~sampleBuffer() -void sampleBuffer::update( bool _keep_settings ) +void SampleBuffer::update( bool _keep_settings ) { const bool lock = ( m_data != NULL ); if( lock ) @@ -225,56 +225,26 @@ void sampleBuffer::update( bool _keep_settings ) } delete[] f; - } - if( m_frames > 0 && buf != NULL ) - { - // following code transforms int-samples into - // float-samples and does amplifying & reversing - const float fac = m_amplification / - OUTPUT_SAMPLE_MULTIPLIER; - m_data = new sampleFrame[m_frames]; - const int ch = ( channels > 1 ) ? 1 : 0; - - // if reversing is on, we also reverse when - // scaling - if( m_reversed ) + if ( m_frames == 0 ) // if still no frames, bail { - int idx = ( m_frames - 1 ) * channels; - for( f_cnt_t frame = 0; frame < m_frames; - ++frame ) - { - m_data[frame][0] = buf[idx+0] * fac; - m_data[frame][1] = buf[idx+ch] * fac; - idx -= channels; - } + // sample couldn't be decoded, create buffer containing + // one sample-frame + m_data = new sampleFrame[1]; + memset( m_data, 0, sizeof( *m_data ) ); + m_frames = 1; + m_loopStartFrame = m_startFrame = 0; + m_loopEndFrame = m_endFrame = 1; } - else + else // otherwise normalize sample rate { - int idx = 0; - for( f_cnt_t frame = 0; frame < m_frames; - ++frame ) - { - m_data[frame][0] = buf[idx+0] * fac; - m_data[frame][1] = buf[idx+ch] * fac; - idx += channels; - } + normalizeSampleRate( samplerate, _keep_settings ); } - delete[] buf; + } + + - normalizeSampleRate( samplerate, _keep_settings ); - } - else - { - // sample couldn't be decoded, create buffer containing - // one sample-frame - m_data = new sampleFrame[1]; - memset( m_data, 0, sizeof( *m_data ) ); - m_frames = 1; - m_loopStartFrame = m_startFrame = 0; - m_loopEndFrame = m_endFrame = 1; - } } else { @@ -296,15 +266,94 @@ void sampleBuffer::update( bool _keep_settings ) } +void SampleBuffer::convertIntToFloat ( int_sample_t * & _ibuf, f_cnt_t _frames, int _channels) +{ + // following code transforms int-samples into + // float-samples and does amplifying & reversing + const float fac = m_amplification / + OUTPUT_SAMPLE_MULTIPLIER; + m_data = new sampleFrame[_frames]; + const int ch = ( _channels > 1 ) ? 1 : 0; + + // if reversing is on, we also reverse when + // scaling + if( m_reversed ) + { + int idx = ( _frames - 1 ) * _channels; + for( f_cnt_t frame = 0; frame < _frames; + ++frame ) + { + m_data[frame][0] = _ibuf[idx+0] * fac; + m_data[frame][1] = _ibuf[idx+ch] * fac; + idx -= _channels; + } + } + else + { + int idx = 0; + for( f_cnt_t frame = 0; frame < _frames; + ++frame ) + { + m_data[frame][0] = _ibuf[idx+0] * fac; + m_data[frame][1] = _ibuf[idx+ch] * fac; + idx += _channels; + } + } + + delete[] _ibuf; -void sampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr, + + + +} + +void SampleBuffer::directFloatWrite ( sample_t * & _fbuf, f_cnt_t _frames, int _channels) + +{ + + m_data = new sampleFrame[_frames]; + const int ch = ( _channels > 1 ) ? 1 : 0; + + // if reversing is on, we also reverse when + // scaling + if( m_reversed ) + { + int idx = ( _frames - 1 ) * _channels; + for( f_cnt_t frame = 0; frame < _frames; + ++frame ) + { + m_data[frame][0] = _fbuf[idx+0]; + m_data[frame][1] = _fbuf[idx+ch]; + idx -= _channels; + } + } + else + { + int idx = 0; + for( f_cnt_t frame = 0; frame < _frames; + ++frame ) + { + m_data[frame][0] = _fbuf[idx+0]; + m_data[frame][1] = _fbuf[idx+ch]; + idx += _channels; + } + } + + delete[] _fbuf; + + + +} + + +void SampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr, bool _keep_settings ) { // do samplerate-conversion to our default-samplerate if( _src_sr != engine::mixer()->baseSampleRate() ) { - sampleBuffer * resampled = resample( this, _src_sr, + SampleBuffer * resampled = resample( this, _src_sr, engine::mixer()->baseSampleRate() ); delete[] m_data; m_frames = resampled->frames(); @@ -325,7 +374,7 @@ void sampleBuffer::normalizeSampleRate( const sample_rate_t _src_sr, -f_cnt_t sampleBuffer::decodeSampleSF( const char * _f, +f_cnt_t SampleBuffer::decodeSampleSF( const char * _f, int_sample_t * & _buf, ch_cnt_t & _channels, sample_rate_t & _samplerate ) @@ -333,15 +382,29 @@ f_cnt_t sampleBuffer::decodeSampleSF( const char * _f, SNDFILE * snd_file; SF_INFO sf_info; f_cnt_t frames = 0; + bool sf_rr = false; + sample_t * fbuf = 0; + if( ( snd_file = sf_open( _f, SFM_READ, &sf_info ) ) != NULL ) { frames = sf_info.frames; - _buf = new int_sample_t[sf_info.channels * frames]; - if( sf_read_short( snd_file, _buf, sf_info.channels * frames ) - < sf_info.channels * frames ) + + // check if float + if ( (sf_info.format & SF_FORMAT_SUBMASK) == SF_FORMAT_FLOAT ) // if yes, use float format for buffer + { + fbuf = new sample_t[sf_info.channels * frames]; + sf_rr = sf_read_float( snd_file, fbuf, sf_info.channels * frames ); + } + else // otherwise, use int + { + _buf = new int_sample_t[sf_info.channels * frames]; + sf_rr = sf_read_short( snd_file, _buf, sf_info.channels * frames ); + } + + if( sf_rr < sf_info.channels * frames ) { #ifdef DEBUG_LMMS - printf( "sampleBuffer::decodeSampleSF(): could not read" + printf( "SampleBuffer::decodeSampleSF(): could not read" " sample %s: %s\n", _f, sf_strerror( NULL ) ); #endif } @@ -353,10 +416,21 @@ f_cnt_t sampleBuffer::decodeSampleSF( const char * _f, else { #ifdef DEBUG_LMMS - printf( "sampleBuffer::decodeSampleSF(): could not load " + printf( "SampleBuffer::decodeSampleSF(): could not load " "sample %s: %s\n", _f, sf_strerror( NULL ) ); #endif } + //write down either directly or convert i->f depending on file type + + if ( frames > 0 && fbuf != NULL ) + { + directFloatWrite ( fbuf, frames, _channels); + } + else if ( frames > 0 && _buf != NULL ) + { + convertIntToFloat ( _buf, frames, _channels); + } + return frames; } @@ -415,7 +489,7 @@ long qfileTellCallback( void * _udata ) -f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f, +f_cnt_t SampleBuffer::decodeSampleOGGVorbis( const char * _f, int_sample_t * & _buf, ch_cnt_t & _channels, sample_rate_t & _samplerate ) @@ -446,23 +520,23 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f, switch( err ) { case OV_EREAD: - printf( "sampleBuffer::decodeSampleOGGVorbis():" + printf( "SampleBuffer::decodeSampleOGGVorbis():" " media read error\n" ); break; case OV_ENOTVORBIS: -/* printf( "sampleBuffer::decodeSampleOGGVorbis():" +/* printf( "SampleBuffer::decodeSampleOGGVorbis():" " not an Ogg Vorbis file\n" );*/ break; case OV_EVERSION: - printf( "sampleBuffer::decodeSampleOGGVorbis():" + printf( "SampleBuffer::decodeSampleOGGVorbis():" " vorbis version mismatch\n" ); break; case OV_EBADHEADER: - printf( "sampleBuffer::decodeSampleOGGVorbis():" + printf( "SampleBuffer::decodeSampleOGGVorbis():" " invalid Vorbis bitstream header\n" ); break; case OV_EFAULT: - printf( "sampleBuffer::decodeSampleOgg(): " + printf( "SampleBuffer::decodeSampleOgg(): " "internal logic fault\n" ); break; } @@ -497,6 +571,12 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f, while( bytes_read != 0 && bitstream == 0 ); ov_clear( &vf ); + // if buffer isn't empty, convert it to float and write it down + + if ( frames > 0 && _buf != NULL ) + { + convertIntToFloat ( _buf, frames, _channels); + } return frames; } @@ -505,19 +585,27 @@ f_cnt_t sampleBuffer::decodeSampleOGGVorbis( const char * _f, -f_cnt_t sampleBuffer::decodeSampleDS( const char * _f, +f_cnt_t SampleBuffer::decodeSampleDS( const char * _f, int_sample_t * & _buf, ch_cnt_t & _channels, sample_rate_t & _samplerate ) { DrumSynth ds; - return ds.GetDSFileSamples( _f, _buf, _channels ); + f_cnt_t frames = ds.GetDSFileSamples( _f, _buf, _channels ); + + if ( frames > 0 && _buf != NULL ) + { + convertIntToFloat ( _buf, frames, _channels); + } + + return frames; + } -bool sampleBuffer::play( sampleFrame * _ab, handleState * _state, +bool SampleBuffer::play( sampleFrame * _ab, handleState * _state, const fpp_t _frames, const float _freq, const bool _looped ) @@ -595,12 +683,12 @@ bool sampleBuffer::play( sampleFrame * _ab, handleState * _state, &src_data ); if( error ) { - printf( "sampleBuffer: error while resampling: %s\n", + printf( "SampleBuffer: error while resampling: %s\n", src_strerror( error ) ); } if( src_data.output_frames_gen > _frames ) { - printf( "sampleBuffer: not enough frames: %ld / %d\n", + printf( "SampleBuffer: not enough frames: %ld / %d\n", src_data.output_frames_gen, _frames ); } // Advance @@ -638,7 +726,7 @@ bool sampleBuffer::play( sampleFrame * _ab, handleState * _state, -sampleFrame * sampleBuffer::getSampleFragment( f_cnt_t _start, +sampleFrame * SampleBuffer::getSampleFragment( f_cnt_t _start, f_cnt_t _frames, bool _looped, sampleFrame * * _tmp ) const { if( _looped ) @@ -685,7 +773,7 @@ sampleFrame * sampleBuffer::getSampleFragment( f_cnt_t _start, -f_cnt_t sampleBuffer::getLoopedIndex( f_cnt_t _index ) const +f_cnt_t SampleBuffer::getLoopedIndex( f_cnt_t _index ) const { if( _index < m_loopEndFrame ) { @@ -698,7 +786,7 @@ f_cnt_t sampleBuffer::getLoopedIndex( f_cnt_t _index ) const -void sampleBuffer::visualize( QPainter & _p, const QRect & _dr, +void SampleBuffer::visualize( QPainter & _p, const QRect & _dr, const QRect & _clip, f_cnt_t _from_frame, f_cnt_t _to_frame ) { const bool focus_on_range = _to_frame <= m_frames @@ -739,7 +827,7 @@ void sampleBuffer::visualize( QPainter & _p, const QRect & _dr, -QString sampleBuffer::openAudioFile() const +QString SampleBuffer::openAudioFile() const { QFileDialog ofd( NULL, tr( "Open audio file" ) ); #if QT_VERSION >= 0x040806 @@ -844,7 +932,7 @@ void flacStreamEncoderMetadataCallback( const FLAC__StreamEncoder *, -QString & sampleBuffer::toBase64( QString & _dst ) const +QString & SampleBuffer::toBase64( QString & _dst ) const { #ifdef LMMS_HAVE_FLAC_STREAM_ENCODER_H const f_cnt_t FRAMES_PER_BUF = 1152; @@ -909,14 +997,14 @@ QString & sampleBuffer::toBase64( QString & _dst ) const -sampleBuffer * sampleBuffer::resample( sampleFrame * _data, +SampleBuffer * SampleBuffer::resample( sampleFrame * _data, const f_cnt_t _frames, const sample_rate_t _src_sr, const sample_rate_t _dst_sr ) { const f_cnt_t dst_frames = static_cast( _frames / (float) _src_sr * (float) _dst_sr ); - sampleBuffer * dst_sb = new sampleBuffer( dst_frames ); + SampleBuffer * dst_sb = new SampleBuffer( dst_frames ); sampleFrame * dst_buf = dst_sb->m_origData; // yeah, libsamplerate, let's rock with sinc-interpolation! @@ -934,7 +1022,7 @@ sampleBuffer * sampleBuffer::resample( sampleFrame * _data, src_data.src_ratio = (double) _dst_sr / _src_sr; if( ( error = src_process( state, &src_data ) ) ) { - printf( "sampleBuffer: error while resampling: %s\n", + printf( "SampleBuffer: error while resampling: %s\n", src_strerror( error ) ); } src_delete( state ); @@ -950,7 +1038,7 @@ sampleBuffer * sampleBuffer::resample( sampleFrame * _data, -void sampleBuffer::setAudioFile( const QString & _audio_file ) +void SampleBuffer::setAudioFile( const QString & _audio_file ) { m_audioFile = tryToMakeRelative( _audio_file ); update(); @@ -1051,7 +1139,7 @@ void flacStreamDecoderErrorCallback( const FLAC__StreamDecoder *, #endif -void sampleBuffer::loadFromBase64( const QString & _data ) +void SampleBuffer::loadFromBase64( const QString & _data ) { char * dst = NULL; int dsize = 0; @@ -1115,7 +1203,7 @@ void sampleBuffer::loadFromBase64( const QString & _data ) -void sampleBuffer::setStartFrame( const f_cnt_t _s ) +void SampleBuffer::setStartFrame( const f_cnt_t _s ) { m_varLock.lock(); m_loopStartFrame = m_startFrame = _s; @@ -1125,7 +1213,7 @@ void sampleBuffer::setStartFrame( const f_cnt_t _s ) -void sampleBuffer::setEndFrame( const f_cnt_t _e ) +void SampleBuffer::setEndFrame( const f_cnt_t _e ) { m_varLock.lock(); m_loopEndFrame = m_endFrame = _e; @@ -1135,7 +1223,7 @@ void sampleBuffer::setEndFrame( const f_cnt_t _e ) -void sampleBuffer::setAmplification( float _a ) +void SampleBuffer::setAmplification( float _a ) { m_amplification = _a; update( true ); @@ -1144,7 +1232,7 @@ void sampleBuffer::setAmplification( float _a ) -void sampleBuffer::setReversed( bool _on ) +void SampleBuffer::setReversed( bool _on ) { m_reversed = _on; update( true ); @@ -1153,7 +1241,7 @@ void sampleBuffer::setReversed( bool _on ) -QString sampleBuffer::tryToMakeRelative( const QString & _file ) +QString SampleBuffer::tryToMakeRelative( const QString & _file ) { if( QFileInfo( _file ).isRelative() == false ) { @@ -1177,7 +1265,7 @@ QString sampleBuffer::tryToMakeRelative( const QString & _file ) -QString sampleBuffer::tryToMakeAbsolute( const QString & _file ) +QString SampleBuffer::tryToMakeAbsolute( const QString & _file ) { if( QFileInfo( _file ).isAbsolute() ) { @@ -1200,7 +1288,7 @@ QString sampleBuffer::tryToMakeAbsolute( const QString & _file ) -sampleBuffer::handleState::handleState( bool _varying_pitch ) : +SampleBuffer::handleState::handleState( bool _varying_pitch ) : m_frameIndex( 0 ), m_varyingPitch( _varying_pitch ) { @@ -1218,7 +1306,7 @@ sampleBuffer::handleState::handleState( bool _varying_pitch ) : -sampleBuffer::handleState::~handleState() +SampleBuffer::handleState::~handleState() { src_delete( m_resamplingData ); } @@ -1226,7 +1314,7 @@ sampleBuffer::handleState::~handleState() -#include "moc_sample_buffer.cxx" +#include "moc_SampleBuffer.cxx" /* vim: set tw=0 noexpandtab: */ diff --git a/src/core/sample_play_handle.cpp b/src/core/SamplePlayHandle.cpp similarity index 70% rename from src/core/sample_play_handle.cpp rename to src/core/SamplePlayHandle.cpp index d9e67624f..57f399818 100644 --- a/src/core/sample_play_handle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -1,7 +1,7 @@ /* - * sample_play_handle.cpp - implementation of class samplePlayHandle + * SamplePlayHandle.cpp - implementation of class SamplePlayHandle * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -22,23 +22,23 @@ * */ -#include "sample_play_handle.h" +#include "SamplePlayHandle.h" #include "AudioPort.h" #include "bb_track.h" #include "engine.h" #include "InstrumentTrack.h" #include "pattern.h" -#include "sample_buffer.h" -#include "sample_track.h" +#include "SampleBuffer.h" +#include "SampleTrack.h" -samplePlayHandle::samplePlayHandle( const QString & _sample_file ) : - playHandle( SamplePlayHandle ), - m_sampleBuffer( new sampleBuffer( _sample_file ) ), +SamplePlayHandle::SamplePlayHandle( const QString& sampleFile ) : + playHandle( playHandle::SamplePlayHandle ), + m_sampleBuffer( new SampleBuffer( sampleFile ) ), m_doneMayReturnTrue( true ), m_frame( 0 ), - m_audioPort( new AudioPort( "samplePlayHandle", false ) ), + m_audioPort( new AudioPort( "SamplePlayHandle", false ) ), m_ownAudioPort( true ), m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ), m_volumeModel( &m_defaultVolumeModel ), @@ -50,12 +50,12 @@ samplePlayHandle::samplePlayHandle( const QString & _sample_file ) : -samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) : - playHandle( SamplePlayHandle ), - m_sampleBuffer( sharedObject::ref( _sample_buffer ) ), +SamplePlayHandle::SamplePlayHandle( SampleBuffer* sampleBuffer ) : + playHandle( playHandle::SamplePlayHandle ), + m_sampleBuffer( sharedObject::ref( sampleBuffer ) ), m_doneMayReturnTrue( true ), m_frame( 0 ), - m_audioPort( new AudioPort( "samplePlayHandle", false ) ), + m_audioPort( new AudioPort( "SamplePlayHandle", false ) ), m_ownAudioPort( true ), m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ), m_volumeModel( &m_defaultVolumeModel ), @@ -67,16 +67,16 @@ samplePlayHandle::samplePlayHandle( sampleBuffer * _sample_buffer ) : -samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) : - playHandle( SamplePlayHandle ), - m_sampleBuffer( sharedObject::ref( _tco->getSampleBuffer() ) ), +SamplePlayHandle::SamplePlayHandle( SampleTCO* tco ) : + playHandle( playHandle::SamplePlayHandle ), + m_sampleBuffer( sharedObject::ref( tco->sampleBuffer() ) ), m_doneMayReturnTrue( true ), m_frame( 0 ), - m_audioPort( ( (sampleTrack *)_tco->getTrack() )->audioPort() ), + m_audioPort( ( (SampleTrack *)tco->getTrack() )->audioPort() ), m_ownAudioPort( false ), m_defaultVolumeModel( DefaultVolume, MinVolume, MaxVolume, 1 ), m_volumeModel( &m_defaultVolumeModel ), - m_track( _tco->getTrack() ), + m_track( tco->getTrack() ), m_bbTrack( NULL ) { } @@ -84,8 +84,8 @@ samplePlayHandle::samplePlayHandle( sampleTCO * _tco ) : -samplePlayHandle::samplePlayHandle( pattern * _pattern ) : - playHandle( SamplePlayHandle ), +SamplePlayHandle::SamplePlayHandle( pattern * _pattern ) : + playHandle( playHandle::SamplePlayHandle ), m_sampleBuffer( sharedObject::ref( _pattern->frozenPattern() ) ), m_doneMayReturnTrue( true ), m_frame( 0 ), @@ -101,7 +101,7 @@ samplePlayHandle::samplePlayHandle( pattern * _pattern ) : -samplePlayHandle::~samplePlayHandle() +SamplePlayHandle::~SamplePlayHandle() { sharedObject::unref( m_sampleBuffer ); if( m_ownAudioPort ) @@ -113,7 +113,7 @@ samplePlayHandle::~samplePlayHandle() -void samplePlayHandle::play( sampleFrame * _working_buffer ) +void SamplePlayHandle::play( sampleFrame * _working_buffer ) { //play( 0, _try_parallelizing ); if( framesDone() >= totalFrames() ) @@ -140,7 +140,7 @@ void samplePlayHandle::play( sampleFrame * _working_buffer ) -bool samplePlayHandle::done() const +bool SamplePlayHandle::done() const { return( framesDone() >= totalFrames() && m_doneMayReturnTrue == true ); } @@ -148,7 +148,7 @@ bool samplePlayHandle::done() const -bool samplePlayHandle::isFromTrack( const track * _track ) const +bool SamplePlayHandle::isFromTrack( const track * _track ) const { return( m_track == _track || m_bbTrack == _track ); } @@ -156,7 +156,7 @@ bool samplePlayHandle::isFromTrack( const track * _track ) const -f_cnt_t samplePlayHandle::totalFrames() const +f_cnt_t SamplePlayHandle::totalFrames() const { return( ( m_sampleBuffer->endFrame() - m_sampleBuffer->startFrame() ) * ( engine::mixer()->processingSampleRate() / diff --git a/src/core/sample_record_handle.cpp b/src/core/SampleRecordHandle.cpp similarity index 76% rename from src/core/sample_record_handle.cpp rename to src/core/SampleRecordHandle.cpp index d539442f8..9d0cff4ad 100644 --- a/src/core/sample_record_handle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -1,5 +1,5 @@ /* - * sample_record_handle.cpp - implementation of class sampleRecordHandle + * SampleRecordHandle.cpp - implementation of class SampleRecordHandle * * Copyright (c) 2008 Csaba Hruska * @@ -23,34 +23,34 @@ */ -#include "sample_record_handle.h" +#include "SampleRecordHandle.h" #include "bb_track.h" #include "engine.h" #include "InstrumentTrack.h" #include "pattern.h" -#include "sample_buffer.h" -#include "sample_track.h" +#include "SampleBuffer.h" +#include "SampleTrack.h" -sampleRecordHandle::sampleRecordHandle( sampleTCO * _tco ) : +SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) : playHandle( SamplePlayHandle ), m_framesRecorded( 0 ), - m_minLength( _tco->length() ), - m_track( _tco->getTrack() ), + m_minLength( tco->length() ), + m_track( tco->getTrack() ), m_bbTrack( NULL ), - m_tco( _tco ) + m_tco( tco ) { } -sampleRecordHandle::~sampleRecordHandle() +SampleRecordHandle::~SampleRecordHandle() { if( !m_buffers.empty() ) { - sampleBuffer * sb; + SampleBuffer* sb; createSampleBuffer( &sb ); m_tco->setSampleBuffer( sb ); } @@ -66,7 +66,7 @@ sampleRecordHandle::~sampleRecordHandle() -void sampleRecordHandle::play( sampleFrame * /*_working_buffer*/ ) +void SampleRecordHandle::play( sampleFrame * /*_working_buffer*/ ) { const sampleFrame * recbuf = engine::mixer()->inputBuffer(); const f_cnt_t frames = engine::mixer()->inputBufferFrames(); @@ -84,7 +84,7 @@ void sampleRecordHandle::play( sampleFrame * /*_working_buffer*/ ) -bool sampleRecordHandle::done() const +bool SampleRecordHandle::done() const { return false; } @@ -92,7 +92,7 @@ bool sampleRecordHandle::done() const -bool sampleRecordHandle::isFromTrack( const track * _track ) const +bool SampleRecordHandle::isFromTrack( const track * _track ) const { return( m_track == _track || m_bbTrack == _track ); } @@ -100,7 +100,7 @@ bool sampleRecordHandle::isFromTrack( const track * _track ) const -f_cnt_t sampleRecordHandle::framesRecorded() const +f_cnt_t SampleRecordHandle::framesRecorded() const { return( m_framesRecorded ); } @@ -108,7 +108,7 @@ f_cnt_t sampleRecordHandle::framesRecorded() const -void sampleRecordHandle::createSampleBuffer( sampleBuffer * * _sample_buf ) +void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf ) { const f_cnt_t frames = framesRecorded(); // create buffer to store all recorded buffers in @@ -128,15 +128,15 @@ void sampleRecordHandle::createSampleBuffer( sampleBuffer * * _sample_buf ) data_ptr += ( *it ).second; } // create according sample-buffer out of big buffer - *_sample_buf = new sampleBuffer( data, frames ); - ( *_sample_buf )->setSampleRate( engine::mixer()->inputSampleRate() ); + *sampleBuf = new SampleBuffer( data, frames ); + ( *sampleBuf)->setSampleRate( engine::mixer()->inputSampleRate() ); delete[] data; } -void sampleRecordHandle::writeBuffer( const sampleFrame * _ab, +void SampleRecordHandle::writeBuffer( const sampleFrame * _ab, const f_cnt_t _frames ) { sampleFrame * buf = new sampleFrame[_frames]; diff --git a/src/core/track_container.cpp b/src/core/TrackContainer.cpp similarity index 82% rename from src/core/track_container.cpp rename to src/core/TrackContainer.cpp index d9266f448..b2cb5df2a 100644 --- a/src/core/track_container.cpp +++ b/src/core/TrackContainer.cpp @@ -1,8 +1,8 @@ /* - * track_container.cpp - implementation of base-class for all track-containers - * like Song-Editor, BB-Editor... + * TrackContainer.cpp - implementation of base class for all trackcontainers + * like Song-Editor, BB-Editor... * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -28,14 +28,14 @@ #include #include -#include "track_container.h" +#include "TrackContainer.h" #include "InstrumentTrack.h" #include "engine.h" #include "MainWindow.h" #include "song.h" -trackContainer::trackContainer() : +TrackContainer::TrackContainer() : Model( NULL ), JournallingObject(), m_tracksMutex(), @@ -46,7 +46,7 @@ trackContainer::trackContainer() : -trackContainer::~trackContainer() +TrackContainer::~TrackContainer() { clearAllTracks(); } @@ -54,7 +54,7 @@ trackContainer::~trackContainer() -void trackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void TrackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setTagName( classNodeName() ); _this.setAttribute( "type", nodeName() ); @@ -71,7 +71,7 @@ void trackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void trackContainer::loadSettings( const QDomElement & _this ) +void TrackContainer::loadSettings( const QDomElement & _this ) { static QProgressDialog * pd = NULL; bool was_null = ( pd == NULL ); @@ -132,7 +132,7 @@ void trackContainer::loadSettings( const QDomElement & _this ) -int trackContainer::countTracks( track::TrackTypes _tt ) const +int TrackContainer::countTracks( track::TrackTypes _tt ) const { int cnt = 0; m_tracksMutex.lockForRead(); @@ -150,7 +150,7 @@ int trackContainer::countTracks( track::TrackTypes _tt ) const -void trackContainer::addTrack( track * _track ) +void TrackContainer::addTrack( track * _track ) { if( _track->type() != track::HiddenAutomationTrack ) { @@ -164,7 +164,7 @@ void trackContainer::addTrack( track * _track ) -void trackContainer::removeTrack( track * _track ) +void TrackContainer::removeTrack( track * _track ) { int index = m_tracks.indexOf( _track ); if( index != -1 ) @@ -183,14 +183,14 @@ void trackContainer::removeTrack( track * _track ) -void trackContainer::updateAfterTrackAdd() +void TrackContainer::updateAfterTrackAdd() { } -void trackContainer::clearAllTracks() +void TrackContainer::clearAllTracks() { //m_tracksMutex.lockForWrite(); while( !m_tracks.isEmpty() ) @@ -203,9 +203,9 @@ void trackContainer::clearAllTracks() -bool trackContainer::isEmpty() const +bool TrackContainer::isEmpty() const { - for( trackList::const_iterator it = m_tracks.begin(); + for( TrackList::const_iterator it = m_tracks.begin(); it != m_tracks.end(); ++it ) { if( !( *it )->getTCOs().isEmpty() ) @@ -222,7 +222,7 @@ bool trackContainer::isEmpty() const DummyTrackContainer::DummyTrackContainer() : - trackContainer(), + TrackContainer(), m_dummyInstrumentTrack( NULL ) { setJournalling( false ); @@ -235,5 +235,5 @@ DummyTrackContainer::DummyTrackContainer() : -#include "moc_track_container.cxx" +#include "moc_TrackContainer.cxx" diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index 311edd848..0e23057e8 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -2,7 +2,7 @@ * AudioSampleRecorder.cpp - device-class that implements recording * audio-buffers into RAM * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -25,7 +25,7 @@ #include "AudioSampleRecorder.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "debug.h" @@ -68,7 +68,7 @@ f_cnt_t AudioSampleRecorder::framesRecorded() const -void AudioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf ) +void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf ) { const f_cnt_t frames = framesRecorded(); // create buffer to store all recorded buffers in @@ -88,8 +88,8 @@ void AudioSampleRecorder::createSampleBuffer( sampleBuffer * * _sample_buf ) data_ptr += ( *it ).second; } // create according sample-buffer out of big buffer - *_sample_buf = new sampleBuffer( data, frames ); - ( *_sample_buf )->setSampleRate( sampleRate() ); + *sampleBuf = new SampleBuffer( data, frames ); + ( *sampleBuf )->setSampleRate( sampleRate() ); delete[] data; } diff --git a/src/core/bb_track_container.cpp b/src/core/bb_track_container.cpp index b016ac15f..58e58517d 100644 --- a/src/core/bb_track_container.cpp +++ b/src/core/bb_track_container.cpp @@ -1,7 +1,7 @@ /* * bb_track_container.cpp - model-component of BB-Editor * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,7 +33,7 @@ bbTrackContainer::bbTrackContainer() : - trackContainer(), + TrackContainer(), m_bbComboBoxModel( this ) { connect( &m_bbComboBoxModel, SIGNAL( dataChanged() ), @@ -66,8 +66,8 @@ bool bbTrackContainer::play( midiTime _start, fpp_t _frames, _start = _start % ( lengthOfBB( _tco_num ) * midiTime::ticksPerTact() ); - trackList tl = tracks(); - for( trackList::iterator it = tl.begin(); it != tl.end(); ++it ) + TrackList tl = tracks(); + for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { if( ( *it )->play( _start, _frames, _offset, _tco_num ) ) { @@ -102,8 +102,8 @@ tact_t bbTrackContainer::lengthOfBB( int _bb ) { midiTime max_length = midiTime::ticksPerTact(); - const trackList & tl = tracks(); - for( trackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) + const TrackList & tl = tracks(); + for( TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { max_length = qMax( max_length, ( *it )->getTCO( _bb )->length() ); @@ -125,8 +125,8 @@ int bbTrackContainer::numOfBBs() const void bbTrackContainer::removeBB( int _bb ) { - trackList tl = tracks(); - for( trackList::iterator it = tl.begin(); it != tl.end(); ++it ) + TrackList tl = tracks(); + for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { delete ( *it )->getTCO( _bb ); ( *it )->removeTact( _bb * DefaultTicksPerTact ); @@ -142,8 +142,8 @@ void bbTrackContainer::removeBB( int _bb ) void bbTrackContainer::swapBB( int _bb1, int _bb2 ) { - trackList tl = tracks(); - for( trackList::iterator it = tl.begin(); it != tl.end(); ++it ) + TrackList tl = tracks(); + for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { ( *it )->swapPositionOfTCOs( _bb1, _bb2 ); } @@ -168,8 +168,8 @@ void bbTrackContainer::updateBBTrack( trackContentObject * _tco ) void bbTrackContainer::fixIncorrectPositions() { - trackList tl = tracks(); - for( trackList::iterator it = tl.begin(); it != tl.end(); ++it ) + TrackList tl = tracks(); + for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { for( int i = 0; i < numOfBBs(); ++i ) { @@ -228,8 +228,8 @@ void bbTrackContainer::currentBBChanged() // now update all track-labels (the current one has to become white, // the others gray) - trackList tl = engine::getSong()->tracks(); - for( trackList::iterator it = tl.begin(); it != tl.end(); ++it ) + TrackList tl = engine::getSong()->tracks(); + for( TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { if( ( *it )->type() == track::BBTrack ) { @@ -248,7 +248,7 @@ void bbTrackContainer::createTCOsForBB( int _bb ) return; } - trackList tl = tracks(); + TrackList tl = tracks(); for( int i = 0; i < tl.size(); ++i ) { while( tl[i]->numOfTCOs() < _bb + 1 ) diff --git a/src/core/preset_preview_play_handle.cpp b/src/core/preset_preview_play_handle.cpp index fa9b2fd9f..09139ba21 100644 --- a/src/core/preset_preview_play_handle.cpp +++ b/src/core/preset_preview_play_handle.cpp @@ -35,12 +35,12 @@ #include "mmp.h" #include "note_play_handle.h" #include "ProjectJournal.h" -#include "track_container.h" +#include "TrackContainer.h" // invisible track-container which is needed as parent for preview-channels -class previewTrackContainer : public trackContainer +class previewTrackContainer : public TrackContainer { public: previewTrackContainer() : diff --git a/src/core/song.cpp b/src/core/song.cpp index 5a7509082..a2c5457aa 100644 --- a/src/core/song.cpp +++ b/src/core/song.cpp @@ -81,7 +81,7 @@ tick_t midiTime::s_ticksPerTact = DefaultTicksPerTact; song::song() : - trackContainer(), + TrackContainer(), m_globalAutomationTrack( dynamic_cast( track::create( track::HiddenAutomationTrack, this ) ) ), @@ -399,7 +399,7 @@ void song::processNextBuffer() return; } - trackList track_list; + TrackList track_list; int tco_num = -1; switch( m_playMode ) @@ -742,7 +742,7 @@ void song::updateLength() { m_length = 0; m_tracksMutex.lockForRead(); - for( trackList::const_iterator it = tracks().begin(); + for( TrackList::const_iterator it = tracks().begin(); it != tracks().end(); ++it ) { const tact_t cur = ( *it )->length(); @@ -867,7 +867,7 @@ void song::stopExport() void song::insertBar() { m_tracksMutex.lockForRead(); - for( trackList::const_iterator it = tracks().begin(); + for( TrackList::const_iterator it = tracks().begin(); it != tracks().end(); ++it ) { ( *it )->insertTact( m_playPos[Mode_PlaySong] ); @@ -881,7 +881,7 @@ void song::insertBar() void song::removeBar() { m_tracksMutex.lockForRead(); - for( trackList::const_iterator it = tracks().begin(); + for( TrackList::const_iterator it = tracks().begin(); it != tracks().end(); ++it ) { ( *it )->removeTact( m_playPos[Mode_PlaySong] ); @@ -1049,7 +1049,7 @@ void song::createNewProject() t = track::create( track::InstrumentTrack, engine::getBBTrackContainer() ); dynamic_cast( t )->loadInstrument( - "tripleoscillator" ); + "kicker" ); track::create( track::SampleTrack, this ); track::create( track::BBTrack, this ); track::create( track::AutomationTrack, this ); diff --git a/src/core/track.cpp b/src/core/track.cpp index 31ea31f67..15c7e32a7 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -2,7 +2,7 @@ * track.cpp - implementation of classes concerning tracks -> necessary for * all track-like objects (beat/bassline, sample-track...) * - * Copyright (c) 2004-2012 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -62,13 +62,13 @@ #include "mmp.h" #include "pixmap_button.h" #include "ProjectJournal.h" -#include "sample_track.h" +#include "SampleTrack.h" #include "song.h" #include "string_pair_drag.h" #include "templates.h" #include "text_float.h" #include "tooltip.h" -#include "track_container.h" +#include "TrackContainer.h" /*! The width of the resize grip in pixels @@ -336,7 +336,7 @@ trackContentObjectView::~trackContentObjectView() // op-buttons of our track-widgets could become focus and when the user // presses space for playing song, just one of these buttons is pressed // which results in unwanted effects - m_trackView->getTrackContainerView()->setFocus(); + m_trackView->trackContainerView()->setFocus(); } @@ -352,7 +352,7 @@ trackContentObjectView::~trackContentObjectView() */ bool trackContentObjectView::fixedTCOs() { - return m_trackView->getTrackContainerView()->fixedTCOs(); + return m_trackView->trackContainerView()->fixedTCOs(); } @@ -425,7 +425,7 @@ void trackContentObjectView::updateLength() midiTime::ticksPerTact() ) + TCO_BORDER_WIDTH * 2-1 ); } - m_trackView->getTrackContainerView()->update(); + m_trackView->trackContainerView()->update(); } @@ -443,7 +443,7 @@ void trackContentObjectView::updatePosition() m_trackView->getTrackContentWidget()->changePosition(); // moving a TCO can result in change of song-length etc., // therefore we update the track-container - m_trackView->getTrackContainerView()->update(); + m_trackView->trackContainerView()->update(); } @@ -532,11 +532,11 @@ void trackContentObjectView::leaveEvent( QEvent * _e ) */ void trackContentObjectView::mousePressEvent( QMouseEvent * _me ) { - if( m_trackView->getTrackContainerView()->allowRubberband() == true && + if( m_trackView->trackContainerView()->allowRubberband() == true && _me->button() == Qt::LeftButton ) { // if rubberband is active, we can be selected - if( !m_trackView->getTrackContainerView()->rubberBandActive() ) + if( !m_trackView->trackContainerView()->rubberBandActive() ) { if( _me->modifiers() & Qt::ControlModifier ) { @@ -650,12 +650,12 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) m_hint = NULL; } - const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact(); + const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); if( m_action == Move ) { const int x = mapToParent( _me->pos() ).x() - m_initialMouseX; midiTime t = qMax( 0, (int) - m_trackView->getTrackContainerView()->currentPosition()+ + m_trackView->trackContainerView()->currentPosition()+ static_cast( x * midiTime::ticksPerTact() / ppt ) ); if( ! ( _me->modifiers() & Qt::ControlModifier ) @@ -676,7 +676,7 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) { const int dx = _me->x() - m_initialMouseX; QVector so = - m_trackView->getTrackContainerView()->selectedObjects(); + m_trackView->trackContainerView()->selectedObjects(); QVector tcos; midiTime smallest_pos, t; // find out smallest position of all selected objects for not @@ -830,7 +830,7 @@ void trackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme ) */ float trackContentObjectView::pixelsPerTact() { - return m_trackView->getTrackContainerView()->pixelsPerTact(); + return m_trackView->trackContainerView()->pixelsPerTact(); } @@ -866,7 +866,7 @@ trackContentWidget::trackContentWidget( trackView * _parent ) : { setAcceptDrops( true ); - connect( _parent->getTrackContainerView(), + connect( _parent->trackContainerView(), SIGNAL( positionChanged( const midiTime & ) ), this, SLOT( changePosition( const midiTime & ) ) ); @@ -890,7 +890,7 @@ trackContentWidget::~trackContentWidget() void trackContentWidget::updateBackground() { const int tactsPerBar = 4; - const trackContainerView * tcv = m_trackView->getTrackContainerView(); + const TrackContainerView * tcv = m_trackView->trackContainerView(); // Assume even-pixels-per-tact. Makes sense, should be like this anyways int ppt = static_cast( tcv->pixelsPerTact() ); @@ -1019,7 +1019,7 @@ void trackContentWidget::update() */ void trackContentWidget::changePosition( const midiTime & _new_pos ) { - if( m_trackView->getTrackContainerView() == engine::getBBEditor() ) + if( m_trackView->trackContainerView() == engine::getBBEditor() ) { const int cur_bb = engine::getBBTrackContainer()->currentBB(); setUpdatesEnabled( false ); @@ -1057,12 +1057,12 @@ void trackContentWidget::changePosition( const midiTime & _new_pos ) midiTime pos = _new_pos; if( pos < 0 ) { - pos = m_trackView->getTrackContainerView()->currentPosition(); + pos = m_trackView->trackContainerView()->currentPosition(); } const int begin = pos; const int end = endPosition( pos ); - const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact(); + const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); setUpdatesEnabled( false ); for( tcoViewVector::iterator it = m_tcoViews.begin(); @@ -1123,7 +1123,7 @@ void trackContentWidget::dropEvent( QDropEvent * _de ) QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); if( type == ( "tco_" + QString::number( getTrack()->type() ) ) && - m_trackView->getTrackContainerView()->fixedTCOs() == false ) + m_trackView->trackContainerView()->fixedTCOs() == false ) { const midiTime pos = getPosition( _de->pos().x() ).toNearestTact(); @@ -1154,7 +1154,7 @@ void trackContentWidget::dropEvent( QDropEvent * _de ) */ void trackContentWidget::mousePressEvent( QMouseEvent * _me ) { - if( m_trackView->getTrackContainerView()->allowRubberband() == true ) + if( m_trackView->trackContainerView()->allowRubberband() == true ) { QWidget::mousePressEvent( _me ); } @@ -1163,7 +1163,7 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me ) QWidget::mousePressEvent( _me ); } else if( _me->button() == Qt::LeftButton && - !m_trackView->getTrackContainerView()->fixedTCOs() ) + !m_trackView->trackContainerView()->fixedTCOs() ) { const midiTime pos = getPosition( _me->x() ).getTact() * midiTime::ticksPerTact(); @@ -1186,11 +1186,11 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me ) void trackContentWidget::paintEvent( QPaintEvent * _pe ) { // Assume even-pixels-per-tact. Makes sense, should be like this anyways - const trackContainerView * tcv = m_trackView->getTrackContainerView(); + const TrackContainerView * tcv = m_trackView->trackContainerView(); int ppt = static_cast( tcv->pixelsPerTact() ); QPainter p( this ); // Don't draw background on BB-Editor - if( m_trackView->getTrackContainerView() != engine::getBBEditor() ) + if( m_trackView->trackContainerView() != engine::getBBEditor() ) { p.drawTiledPixmap( rect(), m_background, QPoint( tcv->currentPosition().getTact() * ppt, 0 ) ); @@ -1297,11 +1297,11 @@ track * trackContentWidget::getTrack() */ midiTime trackContentWidget::getPosition( int _mouse_x ) { - return midiTime( m_trackView->getTrackContainerView()-> + return midiTime( m_trackView->trackContainerView()-> currentPosition() + _mouse_x * midiTime::ticksPerTact() / static_cast( m_trackView-> - getTrackContainerView()->pixelsPerTact() ) ); + trackContainerView()->pixelsPerTact() ) ); } @@ -1312,7 +1312,7 @@ midiTime trackContentWidget::getPosition( int _mouse_x ) */ midiTime trackContentWidget::endPosition( const midiTime & _pos_start ) { - const float ppt = m_trackView->getTrackContainerView()->pixelsPerTact(); + const float ppt = m_trackView->trackContainerView()->pixelsPerTact(); const int w = width(); return _pos_start + static_cast( w * midiTime::ticksPerTact() / ppt ); } @@ -1393,7 +1393,7 @@ trackOperationsWidget::trackOperationsWidget( trackView * _parent ) : toolTip::add( m_soloBtn, tr( "Solo" ) ); connect( this, SIGNAL( trackRemovalScheduled( trackView * ) ), - m_trackView->getTrackContainerView(), + m_trackView->trackContainerView(), SLOT( deleteTrackView( trackView * ) ), Qt::QueuedConnection ); } @@ -1545,7 +1545,7 @@ void trackOperationsWidget::updateMenu() * * \todo check the definitions of all the properties - are they OK? */ -track::track( TrackTypes _type, trackContainer * _tc ) : +track::track( TrackTypes _type, TrackContainer * _tc ) : Model( _tc ), /*!< The track Model */ m_trackContainer( _tc ), /*!< The track container object */ m_type( _type ), /*!< The track type */ @@ -1594,7 +1594,7 @@ track::~track() * \param _tt The type of track to create * \param _tc The track container to attach to */ -track * track::create( TrackTypes _tt, trackContainer * _tc ) +track * track::create( TrackTypes _tt, TrackContainer * _tc ) { track * t = NULL; @@ -1602,7 +1602,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc ) { case InstrumentTrack: t = new ::InstrumentTrack( _tc ); break; case BBTrack: t = new bbTrack( _tc ); break; - case SampleTrack: t = new sampleTrack( _tc ); break; + case SampleTrack: t = new ::SampleTrack( _tc ); break; // case EVENT_TRACK: // case VIDEO_TRACK: case AutomationTrack: t = new ::AutomationTrack( _tc ); break; @@ -1619,12 +1619,12 @@ track * track::create( TrackTypes _tt, trackContainer * _tc ) -/*! \brief Create a track inside trackContainer from track type in a QDomElement and restore state from XML +/*! \brief Create a track inside TrackContainer from track type in a QDomElement and restore state from XML * * \param _this The QDomElement containing the type of track to create * \param _tc The track container to attach to */ -track * track::create( const QDomElement & _this, trackContainer * _tc ) +track * track::create( const QDomElement & _this, TrackContainer * _tc ) { track * t = create( static_cast( _this.attribute( "type" ).toInt() ), @@ -2039,10 +2039,10 @@ tact_t track::length() const */ void track::toggleSolo() { - const trackContainer::trackList & tl = m_trackContainer->tracks(); + const TrackContainer::TrackList & tl = m_trackContainer->tracks(); bool solo_before = false; - for( trackContainer::trackList::const_iterator it = tl.begin(); + for( TrackContainer::TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { if( *it != this ) @@ -2056,7 +2056,7 @@ void track::toggleSolo() } const bool solo = m_soloModel.value(); - for( trackContainer::trackList::const_iterator it = tl.begin(); + for( TrackContainer::TrackList::const_iterator it = tl.begin(); it != tl.end(); ++it ) { if( solo ) @@ -2097,7 +2097,7 @@ void track::toggleSolo() * \param _tcv The track Container View for us to be displayed in. * \todo Is my description of these properties correct? */ -trackView::trackView( track * _track, trackContainerView * _tcv ) : +trackView::trackView( track * _track, TrackContainerView * _tcv ) : QWidget( _tcv->contentWidget() ), /*!< The Track Container View's content widget. */ ModelView( NULL, this ), /*!< The model view of this track */ m_track( _track ), /*!< The track we're displaying */ diff --git a/src/gui/AutomationEditor.cpp b/src/gui/AutomationEditor.cpp index aef24e08c..55381d8b1 100644 --- a/src/gui/AutomationEditor.cpp +++ b/src/gui/AutomationEditor.cpp @@ -2,7 +2,7 @@ * AutomationEditor.cpp - implementation of AutomationEditor which is used for * actual setting of dynamic values * - * Copyright (c) 2008-2013 Tobias Doerffel + * Copyright (c) 2008-2014 Tobias Doerffel * Copyright (c) 2008-2013 Paul Giblock * Copyright (c) 2006-2008 Javier Serrano Polo * @@ -1848,8 +1848,7 @@ inline bool AutomationEditor::inBBEditor() { QMutexLocker m( &m_patternMutex ); return( validPattern() && - m_pattern->getTrack()->getTrackContainer() - == engine::getBBTrackContainer() ); + m_pattern->getTrack()->trackContainer() == engine::getBBTrackContainer() ); } diff --git a/src/gui/track_container_view.cpp b/src/gui/TrackContainerView.cpp similarity index 84% rename from src/gui/track_container_view.cpp rename to src/gui/TrackContainerView.cpp index 94c35dc5b..214d802a1 100644 --- a/src/gui/track_container_view.cpp +++ b/src/gui/TrackContainerView.cpp @@ -1,7 +1,7 @@ /* - * track_container_view.cpp - view-component for trackContainer + * TrackContainerView.cpp - view-component for TrackContainer * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -31,8 +31,8 @@ #include -#include "track_container_view.h" -#include "track_container.h" +#include "TrackContainerView.h" +#include "TrackContainer.h" #include "bb_track.h" #include "MainWindow.h" #include "debug.h" @@ -47,7 +47,7 @@ #include "track.h" -trackContainerView::trackContainerView( trackContainer * _tc ) : +TrackContainerView::TrackContainerView( TrackContainer * _tc ) : QWidget(), ModelView( NULL, this ), JournallingObject(), @@ -90,7 +90,7 @@ trackContainerView::trackContainerView( trackContainer * _tc ) : -trackContainerView::~trackContainerView() +TrackContainerView::~TrackContainerView() { while( !m_trackViews.empty() ) { @@ -102,7 +102,7 @@ trackContainerView::~trackContainerView() -void trackContainerView::saveSettings( QDomDocument & _doc, +void TrackContainerView::saveSettings( QDomDocument & _doc, QDomElement & _this ) { MainWindow::saveWidgetState( this, _this ); @@ -111,7 +111,7 @@ void trackContainerView::saveSettings( QDomDocument & _doc, -void trackContainerView::loadSettings( const QDomElement & _this ) +void TrackContainerView::loadSettings( const QDomElement & _this ) { MainWindow::restoreWidgetState( this, _this ); } @@ -119,7 +119,7 @@ void trackContainerView::loadSettings( const QDomElement & _this ) -trackView * trackContainerView::addTrackView( trackView * _tv ) +trackView * TrackContainerView::addTrackView( trackView * _tv ) { /* QMap map; map["id"] = _tv->getTrack()->id(); @@ -137,7 +137,7 @@ trackView * trackContainerView::addTrackView( trackView * _tv ) -void trackContainerView::removeTrackView( trackView * _tv ) +void TrackContainerView::removeTrackView( trackView * _tv ) { int index = m_trackViews.indexOf( _tv ); if( index != -1 ) @@ -165,7 +165,7 @@ void trackContainerView::removeTrackView( trackView * _tv ) -void trackContainerView::moveTrackViewUp( trackView * _tv ) +void TrackContainerView::moveTrackViewUp( trackView * _tv ) { for( int i = 1; i < m_trackViews.size(); ++i ) { @@ -187,7 +187,7 @@ void trackContainerView::moveTrackViewUp( trackView * _tv ) -void trackContainerView::moveTrackViewDown( trackView * _tv ) +void TrackContainerView::moveTrackViewDown( trackView * _tv ) { for( int i = 0; i < m_trackViews.size()-1; ++i ) { @@ -210,7 +210,7 @@ void trackContainerView::moveTrackViewDown( trackView * _tv ) -void trackContainerView::realignTracks() +void TrackContainerView::realignTracks() { QWidget * content = m_scrollArea->widget(); content->setFixedWidth( width() @@ -228,7 +228,7 @@ void trackContainerView::realignTracks() -void trackContainerView::createTrackView( track * _t ) +void TrackContainerView::createTrackView( track * _t ) { _t->createView( this ); } @@ -236,7 +236,7 @@ void trackContainerView::createTrackView( track * _t ) -void trackContainerView::deleteTrackView( trackView * _tv ) +void TrackContainerView::deleteTrackView( trackView * _tv ) { track * t = _tv->getTrack(); removeTrackView( _tv ); @@ -250,7 +250,7 @@ void trackContainerView::deleteTrackView( trackView * _tv ) -const trackView * trackContainerView::trackViewAt( const int _y ) const +const trackView * TrackContainerView::trackViewAt( const int _y ) const { const int abs_y = _y + m_scrollArea->viewport()->y(); int y_cnt = 0; @@ -270,7 +270,7 @@ const trackView * trackContainerView::trackViewAt( const int _y ) const -bool trackContainerView::allowRubberband() const +bool TrackContainerView::allowRubberband() const { return( false ); } @@ -278,7 +278,7 @@ bool trackContainerView::allowRubberband() const -void trackContainerView::setPixelsPerTact( int _ppt ) +void TrackContainerView::setPixelsPerTact( int _ppt ) { m_ppt = _ppt; @@ -293,7 +293,7 @@ void trackContainerView::setPixelsPerTact( int _ppt ) -void trackContainerView::clearAllTracks() +void TrackContainerView::clearAllTracks() { while( !m_trackViews.empty() ) { @@ -307,7 +307,7 @@ void trackContainerView::clearAllTracks() -void trackContainerView::undoStep( JournalEntry & _je ) +void TrackContainerView::undoStep( JournalEntry & _je ) { #if 0 saveJournallingState( false ); @@ -345,7 +345,7 @@ void trackContainerView::undoStep( JournalEntry & _je ) -void trackContainerView::redoStep( JournalEntry & _je ) +void TrackContainerView::redoStep( JournalEntry & _je ) { #if 0 switch( _je.actionID() ) @@ -365,7 +365,7 @@ void trackContainerView::redoStep( JournalEntry & _je ) -void trackContainerView::dragEnterEvent( QDragEnterEvent * _dee ) +void TrackContainerView::dragEnterEvent( QDragEnterEvent * _dee ) { stringPairDrag::processDragEnterEvent( _dee, QString( "presetfile,pluginpresetfile,samplefile,instrument," @@ -377,7 +377,7 @@ void trackContainerView::dragEnterEvent( QDragEnterEvent * _dee ) -void trackContainerView::dropEvent( QDropEvent * _de ) +void TrackContainerView::dropEvent( QDropEvent * _de ) { QString type = stringPairDrag::decodeKey( _de ); QString value = stringPairDrag::decodeValue( _de ); @@ -431,7 +431,7 @@ void trackContainerView::dropEvent( QDropEvent * _de ) -void trackContainerView::mousePressEvent( QMouseEvent * _me ) +void TrackContainerView::mousePressEvent( QMouseEvent * _me ) { if( allowRubberband() == true ) { @@ -445,7 +445,7 @@ void trackContainerView::mousePressEvent( QMouseEvent * _me ) -void trackContainerView::mouseMoveEvent( QMouseEvent * _me ) +void TrackContainerView::mouseMoveEvent( QMouseEvent * _me ) { if( rubberBandActive() == true ) { @@ -459,7 +459,7 @@ void trackContainerView::mouseMoveEvent( QMouseEvent * _me ) -void trackContainerView::mouseReleaseEvent( QMouseEvent * _me ) +void TrackContainerView::mouseReleaseEvent( QMouseEvent * _me ) { m_rubberBand->hide(); QWidget::mouseReleaseEvent( _me ); @@ -469,7 +469,7 @@ void trackContainerView::mouseReleaseEvent( QMouseEvent * _me ) -void trackContainerView::resizeEvent( QResizeEvent * _re ) +void TrackContainerView::resizeEvent( QResizeEvent * _re ) { realignTracks(); QWidget::resizeEvent( _re ); @@ -478,7 +478,7 @@ void trackContainerView::resizeEvent( QResizeEvent * _re ) -trackContainerView::scrollArea::scrollArea( trackContainerView * _parent ) : +TrackContainerView::scrollArea::scrollArea( TrackContainerView * _parent ) : QScrollArea( _parent ), m_trackContainerView( _parent ) { @@ -490,14 +490,14 @@ trackContainerView::scrollArea::scrollArea( trackContainerView * _parent ) : -trackContainerView::scrollArea::~scrollArea() +TrackContainerView::scrollArea::~scrollArea() { } -void trackContainerView::scrollArea::wheelEvent( QWheelEvent * _we ) +void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we ) { // always pass wheel-event to parent-widget (song-editor // bb-editor etc.) because they might want to use it for zooming @@ -514,5 +514,5 @@ void trackContainerView::scrollArea::wheelEvent( QWheelEvent * _we ) -#include "moc_track_container_view.cxx" +#include "moc_TrackContainerView.cxx" diff --git a/src/gui/bb_editor.cpp b/src/gui/bb_editor.cpp index 9104e2e94..8045c8af1 100644 --- a/src/gui/bb_editor.cpp +++ b/src/gui/bb_editor.cpp @@ -38,9 +38,9 @@ -bbEditor::bbEditor( bbTrackContainer * _tc ) : - trackContainerView( _tc ), - m_bbtc( _tc ) +bbEditor::bbEditor( bbTrackContainer* tc ) : + TrackContainerView( tc ), + m_bbtc( tc ) { // create toolbar m_toolBar = new QWidget; @@ -108,7 +108,7 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : m_bbComboBox = new comboBox( m_toolBar ); m_bbComboBox->setFixedSize( 200, 22 ); - m_bbComboBox->setModel( &_tc->m_bbComboBoxModel ); + m_bbComboBox->setModel( &tc->m_bbComboBoxModel ); tb_layout->addSpacing( 5 ); tb_layout->addWidget( m_playButton ); @@ -130,8 +130,8 @@ bbEditor::bbEditor( bbTrackContainer * _tc ) : parentWidget()->show(); - setModel( _tc ); - connect( &_tc->m_bbComboBoxModel, SIGNAL( dataChanged() ), + setModel( tc ); + connect( &tc->m_bbComboBoxModel, SIGNAL( dataChanged() ), this, SLOT( updatePosition() ) ); } diff --git a/src/gui/export_project_dialog.cpp b/src/gui/export_project_dialog.cpp index 3b9dd2de4..2b3d8258d 100644 --- a/src/gui/export_project_dialog.cpp +++ b/src/gui/export_project_dialog.cpp @@ -186,10 +186,10 @@ void exportProjectDialog::multiRender() int x = 1; - const trackContainer::trackList & tl = engine::getSong()->tracks(); + const TrackContainer::TrackList & tl = engine::getSong()->tracks(); // Check for all unmuted tracks. Remember list. - for( trackContainer::trackList::ConstIterator it = tl.begin(); + for( TrackContainer::TrackList::ConstIterator it = tl.begin(); it != tl.end(); ++it ) { track* tk = (*it); @@ -213,8 +213,8 @@ void exportProjectDialog::multiRender() } - const trackContainer::trackList t2 = engine::getBBTrackContainer()->tracks(); - for( trackContainer::trackList::ConstIterator it = t2.begin(); it != t2.end(); ++it ) + const TrackContainer::TrackList t2 = engine::getBBTrackContainer()->tracks(); + for( TrackContainer::TrackList::ConstIterator it = t2.begin(); it != t2.end(); ++it ) { track* tk = (*it); if ( tk->isMuted() == false ) diff --git a/src/gui/file_browser.cpp b/src/gui/file_browser.cpp index cdfcb319a..2900f9332 100644 --- a/src/gui/file_browser.cpp +++ b/src/gui/file_browser.cpp @@ -2,7 +2,7 @@ * file_browser.cpp - implementation of the project-, preset- and * sample-file-browser * - * Copyright (c) 2004-2009 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -45,7 +45,7 @@ #include "MainWindow.h" #include "mmp.h" #include "preset_preview_play_handle.h" -#include "sample_play_handle.h" +#include "SamplePlayHandle.h" #include "song.h" #include "string_pair_drag.h" #include "text_float.h" @@ -418,7 +418,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) } // in special case of sample-files we do not care about - // handling() rather than directly creating a samplePlayHandle + // handling() rather than directly creating a SamplePlayHandle if( f->type() == fileItem::SampleFile ) { textFloat * tf = textFloat::displayMessage( @@ -429,7 +429,7 @@ void fileBrowserTreeWidget::mousePressEvent( QMouseEvent * _me ) 24, 24 ), 0 ); qApp->processEvents( QEventLoop::ExcludeUserInputEvents ); - samplePlayHandle * s = new samplePlayHandle( + SamplePlayHandle * s = new SamplePlayHandle( f->fullName() ); s->setDoneMayReturnTrue( false ); m_previewPlayHandle = s; @@ -520,7 +520,7 @@ void fileBrowserTreeWidget::mouseReleaseEvent( QMouseEvent * _me ) if( m_previewPlayHandle->type() == playHandle::SamplePlayHandle ) { - samplePlayHandle * s = dynamic_cast( + SamplePlayHandle * s = dynamic_cast( m_previewPlayHandle ); if( s && s->totalFrames() - s->framesDone() <= static_cast( engine::mixer()-> @@ -626,14 +626,14 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item, -void fileBrowserTreeWidget::openInNewInstrumentTrack( trackContainer * _tc ) +void fileBrowserTreeWidget::openInNewInstrumentTrack( TrackContainer* tc ) { if( m_contextMenuItem->handling() == fileItem::LoadAsPreset || m_contextMenuItem->handling() == fileItem::LoadByPlugin ) { engine::mixer()->lock(); InstrumentTrack * it = dynamic_cast( - track::create( track::InstrumentTrack, _tc ) ); + track::create( track::InstrumentTrack, tc ) ); handleFile( m_contextMenuItem, it ); engine::mixer()->unlock(); } diff --git a/src/gui/piano_roll.cpp b/src/gui/piano_roll.cpp index 41cdc060e..76347441a 100644 --- a/src/gui/piano_roll.cpp +++ b/src/gui/piano_roll.cpp @@ -45,6 +45,7 @@ #include #include +#include "config_mgr.h" #include "piano_roll.h" #include "bb_track_container.h" #include "Clipboard.h" @@ -2651,7 +2652,66 @@ void pianoRoll::dragNotes( int x, int y, bool alt, bool shift ) engine::getSong()->setModified(); } +static QString calculateNoteLabel(QString note, int octave) +{ + if(note.isEmpty()) + return ""; + return note + QString::number(octave); +} +static void printNoteHeights(QPainter& p, int bottom, int width, int startKey) +{ + assert(Key_C == 0); + assert(Key_H == 11); + + struct KeyLabel + { + QString key, minor, major; + }; + const KeyLabel labels[12] = { + {QObject::tr("C", "Note name")}, + {"", QObject::tr("Db", "Note name"), QObject::tr("C#", "Note name")}, + {QObject::tr("D", "Note name")}, + {"", QObject::tr("Eb", "Note name"), QObject::tr("D#", "Note name")}, + {QObject::tr("E", "Note name"), QObject::tr("Fb", "Note name")}, + {"F"}, + {"", QObject::tr("Gb", "Note name"), QObject::tr("F#", "Note name")}, + {QObject::tr("G", "Note name")}, + {"", QObject::tr("Ab", "Note name"),QObject::tr( "G#", "Note name")}, + {QObject::tr("A", "Note name")}, + {"", QObject::tr("Bb", "Note name"),QObject::tr( "A#", "Note name")}, + {QObject::tr("B", "Note name")} + }; + + p.setFont( pointSize( p.font() ) ); + p.setPen( QColor( 255, 255, 0 ) ); + for( int y = bottom, key = startKey; y > PR_TOP_MARGIN; + y -= KEY_LINE_HEIGHT, key++) + { + const unsigned note = key % KeysPerOctave; + assert( note < ( sizeof( labels ) / sizeof( *labels) )); + const KeyLabel& noteLabel( labels[note] ); + const int octave = key / KeysPerOctave; + const KeyLabel notes = { + calculateNoteLabel(noteLabel.key, octave), + calculateNoteLabel(noteLabel.minor, octave), + calculateNoteLabel(noteLabel.major, octave), + }; + + + const int drawWidth( width - WHITE_KEY_WIDTH ); + const int hspace = 300; + const int columnCount = drawWidth/hspace + 1; + for(int col = 0; col < columnCount; col++) + { + const int subOffset = 42; + const int x = subOffset + hspace/2 + hspace * col; + p.drawText( WHITE_KEY_WIDTH + x, y, notes.key); + p.drawText( WHITE_KEY_WIDTH + x - subOffset, y, notes.minor); + p.drawText( WHITE_KEY_WIDTH + x + subOffset, y, notes.major); + } + } +} void pianoRoll::paintEvent( QPaintEvent * _pe ) { @@ -3125,6 +3185,11 @@ void pianoRoll::paintEvent( QPaintEvent * _pe ) p.drawPixmap( mapFromGlobal( QCursor::pos() ) + QPoint( 8, 8 ), *cursor ); } + + if( configManager::inst()->value( "ui", "printnotelabels").toInt() ) + { + printNoteHeights(p, keyAreaBottom(), width(), m_startKey); + } } @@ -3229,7 +3294,7 @@ int pianoRoll::getKey( int _y ) const song::PlayModes pianoRoll::desiredPlayModeForAccompany() const { - if( m_pattern->getTrack()->getTrackContainer() == + if( m_pattern->getTrack()->trackContainer() == engine::getBBTrackContainer() ) { return song::Mode_PlayBB; @@ -3292,7 +3357,7 @@ void pianoRoll::recordAccompany() m_recording = true; - if( m_pattern->getTrack()->getTrackContainer() == engine::getSong() ) + if( m_pattern->getTrack()->trackContainer() == engine::getSong() ) { engine::getSong()->playSong(); } diff --git a/src/gui/setup_dialog.cpp b/src/gui/setup_dialog.cpp index 670651eb3..ffebdfd29 100644 --- a/src/gui/setup_dialog.cpp +++ b/src/gui/setup_dialog.cpp @@ -121,7 +121,9 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : m_syncVSTPlugins( configManager::inst()->value( "ui", "syncvstplugins" ).toInt() ), m_animateAFP(configManager::inst()->value( "ui", - "animateafp").toInt() ) + "animateafp").toInt() ), + m_printNoteLabels(configManager::inst()->value( "ui", + "printnotelabels").toInt() ) { setWindowIcon( embed::getIconPixmap( "setup_general" ) ); setWindowTitle( tr( "Setup LMMS" ) ); @@ -190,12 +192,17 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : tabWidget * misc_tw = new tabWidget( tr( "MISC" ), general ); - misc_tw->setFixedHeight( 174 ); + const int XDelta = 10; + const int YDelta = 18; + const int HeaderSize = 30; + int labelNumber = 0; + ledCheckBox * enable_tooltips = new ledCheckBox( tr( "Enable tooltips" ), misc_tw ); - enable_tooltips->move( 10, 18 ); + labelNumber++; + enable_tooltips->move( XDelta, YDelta*labelNumber ); enable_tooltips->setChecked( m_toolTips ); connect( enable_tooltips, SIGNAL( toggled( bool ) ), this, SLOT( toggleToolTips( bool ) ) ); @@ -204,7 +211,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * restart_msg = new ledCheckBox( tr( "Show restart warning after changing settings" ), misc_tw ); - restart_msg->move( 10, 36 ); + labelNumber++; + restart_msg->move( XDelta, YDelta*labelNumber ); restart_msg->setChecked( m_warnAfterSetup ); connect( restart_msg, SIGNAL( toggled( bool ) ), this, SLOT( toggleWarnAfterSetup( bool ) ) ); @@ -212,7 +220,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * dbv = new ledCheckBox( tr( "Display volume as dBV " ), misc_tw ); - dbv->move( 10, 54 ); + labelNumber++; + dbv->move( XDelta, YDelta*labelNumber ); dbv->setChecked( m_displaydBV ); connect( dbv, SIGNAL( toggled( bool ) ), this, SLOT( toggleDisplaydBV( bool ) ) ); @@ -221,7 +230,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * mmpz = new ledCheckBox( tr( "Compress project files per default" ), misc_tw ); - mmpz->move( 10, 72 ); + labelNumber++; + mmpz->move( XDelta, YDelta*labelNumber ); mmpz->setChecked( m_MMPZ ); connect( mmpz, SIGNAL( toggled( bool ) ), this, SLOT( toggleMMPZ( bool ) ) ); @@ -229,7 +239,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * oneitw = new ledCheckBox( tr( "One instrument track window mode" ), misc_tw ); - oneitw->move( 10, 90 ); + labelNumber++; + oneitw->move( XDelta, YDelta*labelNumber ); oneitw->setChecked( m_oneInstrumentTrackWindow ); connect( oneitw, SIGNAL( toggled( bool ) ), this, SLOT( toggleOneInstrumentTrackWindow( bool ) ) ); @@ -237,7 +248,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * hqaudio = new ledCheckBox( tr( "HQ-mode for output audio-device" ), misc_tw ); - hqaudio->move( 10, 108 ); + labelNumber++; + hqaudio->move( XDelta, YDelta*labelNumber ); hqaudio->setChecked( m_hqAudioDev ); connect( hqaudio, SIGNAL( toggled( bool ) ), this, SLOT( toggleHQAudioDev( bool ) ) ); @@ -245,7 +257,8 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * compacttracks = new ledCheckBox( tr( "Compact track buttons" ), misc_tw ); - compacttracks->move( 10, 126 ); + labelNumber++; + compacttracks->move( XDelta, YDelta*labelNumber ); compacttracks->setChecked( m_compactTrackButtons ); connect( compacttracks, SIGNAL( toggled( bool ) ), this, SLOT( toggleCompactTrackButtons( bool ) ) ); @@ -254,11 +267,22 @@ setupDialog::setupDialog( ConfigTabs _tab_to_open ) : ledCheckBox * syncVST = new ledCheckBox( tr( "Sync VST plugins to host playback" ), misc_tw ); - syncVST->move( 10, 144 ); + labelNumber++; + syncVST->move( XDelta, YDelta*labelNumber ); syncVST->setChecked( m_syncVSTPlugins ); connect( syncVST, SIGNAL( toggled( bool ) ), this, SLOT( toggleSyncVSTPlugins( bool ) ) ); + ledCheckBox * noteLabels = new ledCheckBox( + tr( "Enable note labels in piano roll" ), + misc_tw ); + labelNumber++; + noteLabels->move( XDelta, YDelta*labelNumber ); + noteLabels->setChecked( m_printNoteLabels ); + connect( noteLabels, SIGNAL( toggled( bool ) ), + this, SLOT( toggleNoteLabels( bool ) ) ); + + misc_tw->setFixedHeight( YDelta*labelNumber + HeaderSize ); gen_layout->addWidget( bufsize_tw ); @@ -800,6 +824,8 @@ void setupDialog::accept() QString::number( m_syncVSTPlugins ) ); configManager::inst()->setValue( "ui", "animateafp", QString::number( m_animateAFP ) ); + configManager::inst()->setValue( "ui", "printnotelabels", + QString::number( m_printNoteLabels ) ); configManager::inst()->setWorkingDir( m_workingDir ); @@ -994,7 +1020,10 @@ void setupDialog::toggleAnimateAFP( bool _enabled ) } - +void setupDialog::toggleNoteLabels( bool en ) +{ + m_printNoteLabels = en; +} void setupDialog::toggleOneInstrumentTrackWindow( bool _enabled ) diff --git a/src/gui/song_editor.cpp b/src/gui/song_editor.cpp index 65e9c889e..929bdd0c0 100644 --- a/src/gui/song_editor.cpp +++ b/src/gui/song_editor.cpp @@ -77,7 +77,7 @@ void positionLine::paintEvent( QPaintEvent * _pe ) songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) : - trackContainerView( _song ), + TrackContainerView( _song ), m_s( _song ), m_scrollBack( false ), m_smoothScroll( configManager::inst()->value( "ui", "smoothscroll" ).toInt() ) diff --git a/src/gui/widgets/graph.cpp b/src/gui/widgets/graph.cpp index b4201383d..538bb2544 100644 --- a/src/gui/widgets/graph.cpp +++ b/src/gui/widgets/graph.cpp @@ -29,7 +29,7 @@ #include "graph.h" #include "string_pair_drag.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "Oscillator.h" #include "engine.h" diff --git a/src/tracks/AutomationTrack.cpp b/src/tracks/AutomationTrack.cpp index 1f92533dd..fc7f50c7c 100644 --- a/src/tracks/AutomationTrack.cpp +++ b/src/tracks/AutomationTrack.cpp @@ -2,7 +2,7 @@ * AutomationTrack.cpp - AutomationTrack handles automation of objects without * a track * - * Copyright (c) 2008-2010 Tobias Doerffel + * Copyright (c) 2008-2014 Tobias Doerffel * Copyright (c) 2006-2008 Javier Serrano Polo * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -30,12 +30,12 @@ #include "embed.h" #include "ProjectJournal.h" #include "string_pair_drag.h" -#include "track_container_view.h" +#include "TrackContainerView.h" #include "track_label_button.h" -AutomationTrack::AutomationTrack( trackContainer * _tc, bool _hidden ) : - track( _hidden ? HiddenAutomationTrack : track::AutomationTrack, _tc ) +AutomationTrack::AutomationTrack( TrackContainer* tc, bool _hidden ) : + track( _hidden ? HiddenAutomationTrack : track::AutomationTrack, tc ) { setName( tr( "Automation track" ) ); } @@ -90,9 +90,9 @@ bool AutomationTrack::play( const midiTime & _start, const fpp_t _frames, -trackView * AutomationTrack::createView( trackContainerView * _tcv ) +trackView * AutomationTrack::createView( TrackContainerView* tcv ) { - return new AutomationTrackView( this, _tcv ); + return new AutomationTrackView( this, tcv ); } @@ -127,9 +127,8 @@ void AutomationTrack::loadTrackSpecificSettings( const QDomElement & _this ) -AutomationTrackView::AutomationTrackView( AutomationTrack * _at, - trackContainerView * _tcv ) : - trackView( _at, _tcv ) +AutomationTrackView::AutomationTrackView( AutomationTrack * _at, TrackContainerView* tcv ) : + trackView( _at, tcv ) { setFixedHeight( 32 ); trackLabelButton * tlb = new trackLabelButton( this, @@ -169,12 +168,12 @@ void AutomationTrackView::dropEvent( QDropEvent * _de ) journallingObject( val.toInt() ) ); if( mod != NULL ) { - midiTime pos = midiTime( getTrackContainerView()-> + midiTime pos = midiTime( trackContainerView()-> currentPosition() + ( _de->pos().x() - getTrackContentWidget()->x() ) * midiTime::ticksPerTact() / - static_cast( getTrackContainerView()->pixelsPerTact() ) ) + static_cast( trackContainerView()->pixelsPerTact() ) ) .toNearestTact(); if( pos.getTicks() < 0 ) diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 7c90d5f0d..b7ccc024f 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -69,7 +69,7 @@ #include "note_play_handle.h" #include "pattern.h" #include "PluginView.h" -#include "sample_play_handle.h" +#include "SamplePlayHandle.h" #include "song.h" #include "string_pair_drag.h" #include "surround_area.h" @@ -91,8 +91,8 @@ const int INSTRUMENT_WINDOW_CACHE_SIZE = 8; // #### IT: -InstrumentTrack::InstrumentTrack( trackContainer * _tc ) : - track( track::InstrumentTrack, _tc ), +InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : + track( track::InstrumentTrack, tc ), MidiEventProcessor(), m_audioPort( tr( "unnamed_track" ) ), m_midiPort( tr( "unnamed_track" ), engine::mixer()->midiClient(), @@ -659,7 +659,7 @@ bool InstrumentTrack::play( const midiTime & _start, continue; } - samplePlayHandle * handle = new samplePlayHandle( p ); + SamplePlayHandle* handle = new SamplePlayHandle( p ); handle->setBBTrack( bb_track ); handle->setOffset( _offset ); // send it to the mixer @@ -745,9 +745,9 @@ trackContentObject * InstrumentTrack::createTCO( const midiTime & ) -trackView * InstrumentTrack::createView( trackContainerView * _tcv ) +trackView * InstrumentTrack::createView( TrackContainerView* tcv ) { - return new InstrumentTrackView( this, _tcv ); + return new InstrumentTrackView( this, tcv ); } @@ -910,9 +910,8 @@ QQueue InstrumentTrackView::s_windowCache; -InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, - trackContainerView * _tcv ) : - trackView( _it, _tcv ), +InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tcv ) : + trackView( _it, tcv ), m_window( NULL ), m_lastPos( -1, -1 ) { diff --git a/src/tracks/sample_track.cpp b/src/tracks/SampleTrack.cpp similarity index 80% rename from src/tracks/sample_track.cpp rename to src/tracks/SampleTrack.cpp index bd3576247..487bdde65 100644 --- a/src/tracks/sample_track.cpp +++ b/src/tracks/SampleTrack.cpp @@ -1,8 +1,8 @@ /* - * sample_track.cpp - implementation of class sampleTrack, a track which - * provides arrangement of samples + * SampleTrack.cpp - implementation of class SampleTrack, a track which + * provides arrangement of samples * - * Copyright (c) 2005-2010 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -33,14 +33,14 @@ #include #include "gui_templates.h" -#include "sample_track.h" +#include "SampleTrack.h" #include "song.h" #include "embed.h" #include "engine.h" #include "tooltip.h" #include "AudioPort.h" -#include "sample_play_handle.h" -#include "sample_record_handle.h" +#include "SamplePlayHandle.h" +#include "SampleRecordHandle.h" #include "string_pair_drag.h" #include "knob.h" #include "MainWindow.h" @@ -49,9 +49,9 @@ #include "config_mgr.h" -sampleTCO::sampleTCO( track * _track ) : +SampleTCO::SampleTCO( track * _track ) : trackContentObject( _track ), - m_sampleBuffer( new sampleBuffer ) + m_sampleBuffer( new SampleBuffer ) { saveJournallingState( false ); setSampleFile( "" ); @@ -66,7 +66,7 @@ sampleTCO::sampleTCO( track * _track ) : -sampleTCO::~sampleTCO() +SampleTCO::~SampleTCO() { sharedObject::unref( m_sampleBuffer ); } @@ -74,7 +74,7 @@ sampleTCO::~sampleTCO() -void sampleTCO::changeLength( const midiTime & _length ) +void SampleTCO::changeLength( const midiTime & _length ) { trackContentObject::changeLength( qMax( static_cast( _length ), DefaultTicksPerTact ) ); @@ -83,17 +83,17 @@ void sampleTCO::changeLength( const midiTime & _length ) -const QString & sampleTCO::sampleFile() const +const QString & SampleTCO::sampleFile() const { return m_sampleBuffer->audioFile(); } -void sampleTCO::setSampleBuffer( sampleBuffer * _sb ) +void SampleTCO::setSampleBuffer( SampleBuffer* sb ) { sharedObject::unref( m_sampleBuffer ); - m_sampleBuffer = _sb; + m_sampleBuffer = sb; updateLength(); emit sampleChanged(); @@ -101,7 +101,7 @@ void sampleTCO::setSampleBuffer( sampleBuffer * _sb ) -void sampleTCO::setSampleFile( const QString & _sf ) +void SampleTCO::setSampleFile( const QString & _sf ) { m_sampleBuffer->setAudioFile( _sf ); updateLength(); @@ -112,7 +112,7 @@ void sampleTCO::setSampleFile( const QString & _sf ) -void sampleTCO::toggleRecord() +void SampleTCO::toggleRecord() { m_recordModel.setValue( !m_recordModel.value() ); emit dataChanged(); @@ -121,7 +121,7 @@ void sampleTCO::toggleRecord() -void sampleTCO::updateLength( bpm_t ) +void SampleTCO::updateLength( bpm_t ) { changeLength( sampleLength() ); } @@ -129,7 +129,7 @@ void sampleTCO::updateLength( bpm_t ) -midiTime sampleTCO::sampleLength() const +midiTime SampleTCO::sampleLength() const { return (int)( m_sampleBuffer->frames() / engine::framesPerTick() ); } @@ -137,7 +137,7 @@ midiTime sampleTCO::sampleLength() const -void sampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void SampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this ) { if( _this.parentNode().nodeName() == "clipboard" ) { @@ -161,7 +161,7 @@ void sampleTCO::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void sampleTCO::loadSettings( const QDomElement & _this ) +void SampleTCO::loadSettings( const QDomElement & _this ) { if( _this.attribute( "pos" ).toInt() >= 0 ) { @@ -179,9 +179,9 @@ void sampleTCO::loadSettings( const QDomElement & _this ) -trackContentObjectView * sampleTCO::createView( trackView * _tv ) +trackContentObjectView * SampleTCO::createView( trackView * _tv ) { - return new sampleTCOView( this, _tv ); + return new SampleTCOView( this, _tv ); } @@ -193,14 +193,14 @@ trackContentObjectView * sampleTCO::createView( trackView * _tv ) -sampleTCOView::sampleTCOView( sampleTCO * _tco, trackView * _tv ) : +SampleTCOView::SampleTCOView( SampleTCO * _tco, trackView * _tv ) : trackContentObjectView( _tco, _tv ), m_tco( _tco ) { // update UI and tooltip updateSample(); - // track future changes of sampleTCO + // track future changes of SampleTCO connect( m_tco, SIGNAL( sampleChanged() ), this, SLOT( updateSample() ) ); } @@ -208,14 +208,14 @@ sampleTCOView::sampleTCOView( sampleTCO * _tco, trackView * _tv ) : -sampleTCOView::~sampleTCOView() +SampleTCOView::~SampleTCOView() { } -void sampleTCOView::updateSample() +void SampleTCOView::updateSample() { update(); // set tooltip to filename so that user can see what sample this @@ -228,7 +228,7 @@ void sampleTCOView::updateSample() -void sampleTCOView::contextMenuEvent( QContextMenuEvent * _cme ) +void SampleTCOView::contextMenuEvent( QContextMenuEvent * _cme ) { QMenu contextMenu( this ); if( fixedTCOs() == false ) @@ -259,7 +259,7 @@ void sampleTCOView::contextMenuEvent( QContextMenuEvent * _cme ) -void sampleTCOView::dragEnterEvent( QDragEnterEvent * _dee ) +void SampleTCOView::dragEnterEvent( QDragEnterEvent * _dee ) { if( stringPairDrag::processDragEnterEvent( _dee, "samplefile,sampledata" ) == false ) @@ -271,7 +271,7 @@ void sampleTCOView::dragEnterEvent( QDragEnterEvent * _dee ) -void sampleTCOView::dropEvent( QDropEvent * _de ) +void SampleTCOView::dropEvent( QDropEvent * _de ) { if( stringPairDrag::decodeKey( _de ) == "samplefile" ) { @@ -296,7 +296,7 @@ void sampleTCOView::dropEvent( QDropEvent * _de ) -void sampleTCOView::mousePressEvent( QMouseEvent * _me ) +void SampleTCOView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::LeftButton && _me->modifiers() & Qt::ControlModifier && @@ -313,7 +313,7 @@ void sampleTCOView::mousePressEvent( QMouseEvent * _me ) -void sampleTCOView::mouseDoubleClickEvent( QMouseEvent * ) +void SampleTCOView::mouseDoubleClickEvent( QMouseEvent * ) { QString af = m_tco->m_sampleBuffer->openAudioFile(); if( af != "" && af != m_tco->m_sampleBuffer->audioFile() ) @@ -326,7 +326,7 @@ void sampleTCOView::mouseDoubleClickEvent( QMouseEvent * ) -void sampleTCOView::paintEvent( QPaintEvent * _pe ) +void SampleTCOView::paintEvent( QPaintEvent * _pe ) { QPainter p( this ); @@ -385,8 +385,8 @@ void sampleTCOView::paintEvent( QPaintEvent * _pe ) -sampleTrack::sampleTrack( trackContainer * _tc ) : - track( SampleTrack, _tc ), +SampleTrack::SampleTrack( TrackContainer* tc ) : + track( track::SampleTrack, tc ), m_audioPort( tr( "Sample track" ) ), m_volumeModel( DefaultVolume, MinVolume, MaxVolume, 1.0, this, tr( "Volume" ) ) @@ -397,7 +397,7 @@ sampleTrack::sampleTrack( trackContainer * _tc ) : -sampleTrack::~sampleTrack() +SampleTrack::~SampleTrack() { engine::mixer()->removePlayHandles( this ); } @@ -405,7 +405,7 @@ sampleTrack::~sampleTrack() -bool sampleTrack::play( const midiTime & _start, const fpp_t _frames, +bool SampleTrack::play( const midiTime & _start, const fpp_t _frames, const f_cnt_t _offset, Sint16 /*_tco_num*/ ) { @@ -419,7 +419,7 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames, { continue; } - sampleTCO * st = dynamic_cast( tco ); + SampleTCO * st = dynamic_cast( tco ); if( !st->isMuted() ) { playHandle * handle; @@ -429,12 +429,12 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames, { return played_a_note; } - sampleRecordHandle * smpHandle = new sampleRecordHandle( st ); + SampleRecordHandle* smpHandle = new SampleRecordHandle( st ); handle = smpHandle; } else { - samplePlayHandle * smpHandle = new samplePlayHandle( st ); + SamplePlayHandle* smpHandle = new SamplePlayHandle( st ); smpHandle->setVolumeModel( &m_volumeModel ); handle = smpHandle; } @@ -453,23 +453,23 @@ bool sampleTrack::play( const midiTime & _start, const fpp_t _frames, -trackView * sampleTrack::createView( trackContainerView * _tcv ) +trackView * SampleTrack::createView( TrackContainerView* tcv ) { - return new sampleTrackView( this, _tcv ); + return new SampleTrackView( this, tcv ); } -trackContentObject * sampleTrack::createTCO( const midiTime & ) +trackContentObject * SampleTrack::createTCO( const midiTime & ) { - return new sampleTCO( this ); + return new SampleTCO( this ); } -void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc, +void SampleTrack::saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _this ) { m_audioPort.effects()->saveState( _doc, _this ); @@ -482,7 +482,7 @@ void sampleTrack::saveTrackSpecificSettings( QDomDocument & _doc, -void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this ) +void SampleTrack::loadTrackSpecificSettings( const QDomElement & _this ) { QDomNode node = _this.firstChild(); m_audioPort.effects()->clear(); @@ -505,8 +505,8 @@ void sampleTrack::loadTrackSpecificSettings( const QDomElement & _this ) -sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv ) : - trackView( _t, _tcv ) +SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : + trackView( _t, tcv ) { setFixedHeight( 32 ); @@ -550,7 +550,7 @@ sampleTrackView::sampleTrackView( sampleTrack * _t, trackContainerView * _tcv ) -sampleTrackView::~sampleTrackView() +SampleTrackView::~SampleTrackView() { m_effWindow->deleteLater(); } @@ -558,7 +558,7 @@ sampleTrackView::~sampleTrackView() -void sampleTrackView::showEffects() +void SampleTrackView::showEffects() { if( m_effWindow->isHidden() ) { @@ -574,9 +574,9 @@ void sampleTrackView::showEffects() -void sampleTrackView::modelChanged() +void SampleTrackView::modelChanged() { - sampleTrack * st = castModel(); + SampleTrack * st = castModel(); m_volumeKnob->setModel( &st->m_volumeModel ); trackView::modelChanged(); @@ -584,5 +584,5 @@ void sampleTrackView::modelChanged() -#include "moc_sample_track.cxx" +#include "moc_SampleTrack.cxx" diff --git a/src/tracks/bb_track.cpp b/src/tracks/bb_track.cpp index 89caac6a9..93f3aa8c5 100644 --- a/src/tracks/bb_track.cpp +++ b/src/tracks/bb_track.cpp @@ -298,8 +298,8 @@ void bbTCOView::setColor( QColor _new_color ) -bbTrack::bbTrack( trackContainer * _tc ) : - track( BBTrack, _tc ) +bbTrack::bbTrack( TrackContainer* tc ) : + track( BBTrack, tc ) { int bbNum = s_infoMap.size(); s_infoMap[this] = bbNum; @@ -333,7 +333,7 @@ bbTrack::~bbTrack() // remove us from TC so bbTrackContainer::numOfBBs() returns a smaller // value and thus combobox-updating in bbTrackContainer works well - getTrackContainer()->removeTrack( this ); + trackContainer()->removeTrack( this ); engine::getBBTrackContainer()->updateComboBox(); } @@ -391,9 +391,9 @@ bool bbTrack::play( const midiTime & _start, const fpp_t _frames, -trackView * bbTrack::createView( trackContainerView * _tcv ) +trackView * bbTrack::createView( TrackContainerView* tcv ) { - return( new bbTrackView( this, _tcv ) ); + return new bbTrackView( this, tcv ); } @@ -454,11 +454,11 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) const int src = _this.attribute( "clonebbt" ).toInt(); const int dst = s_infoMap[this]; engine::getBBTrackContainer()->createTCOsForBB( dst ); - trackContainer::trackList tl = + TrackContainer::TrackList tl = engine::getBBTrackContainer()->tracks(); // copy TCOs of all tracks from source BB (at bar "src") to destination // TCOs (which are created if they do not exist yet) - for( trackContainer::trackList::iterator it = tl.begin(); + for( TrackContainer::TrackList::iterator it = tl.begin(); it != tl.end(); ++it ) { ( *it )->getTCO( src )->copy(); @@ -470,7 +470,7 @@ void bbTrack::loadTrackSpecificSettings( const QDomElement & _this ) else { QDomNode node = _this.namedItem( - trackContainer::classNodeName() ); + TrackContainer::classNodeName() ); if( node.isElement() ) { ( (JournallingObject *)engine::getBBTrackContainer() )-> @@ -539,8 +539,8 @@ void bbTrack::swapBBTracks( track * _track1, track * _track2 ) -bbTrackView::bbTrackView( bbTrack * _bbt, trackContainerView * _tcv ) : - trackView( _bbt, _tcv ), +bbTrackView::bbTrackView( bbTrack * _bbt, TrackContainerView* tcv ) : + trackView( _bbt, tcv ), m_bbTrack( _bbt ) { setFixedHeight( 32 ); @@ -583,7 +583,7 @@ void bbTrackView::clickedTrackLabel() bbTrack::numOfBBTrack( m_bbTrack ) ); engine::getBBEditor()->show(); /* foreach( bbTrackView * tv, - getTrackContainerView()->findChildren() ) + trackContainerView()->findChildren() ) { tv->m_trackLabel->update(); }*/ diff --git a/src/tracks/pattern.cpp b/src/tracks/pattern.cpp index 3a7f0ebca..5ad261ca8 100644 --- a/src/tracks/pattern.cpp +++ b/src/tracks/pattern.cpp @@ -1,7 +1,7 @@ /* * pattern.cpp - implementation of class pattern which holds notes * - * Copyright (c) 2004-2012 Tobias Doerffel + * Copyright (c) 2004-2014 Tobias Doerffel * Copyright (c) 2005-2007 Danny McRae * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net @@ -40,9 +40,9 @@ #include "embed.h" #include "engine.h" #include "piano_roll.h" -#include "track_container.h" +#include "TrackContainer.h" #include "rename_dialog.h" -#include "sample_buffer.h" +#include "SampleBuffer.h" #include "AudioSampleRecorder.h" #include "song.h" #include "tooltip.h" @@ -563,7 +563,7 @@ void pattern::ensureBeatNotes() void pattern::updateBBTrack() { - if( getTrack()->getTrackContainer() == engine::getBBTrackContainer() ) + if( getTrack()->trackContainer() == engine::getBBTrackContainer() ) { engine::getBBTrackContainer()->updateBBTrack( this ); }