Merge remote-tracking branch 'origin/stable-1.1'
Conflicts: data/locale/zh.ts src/tracks/Pattern.cpp
This commit is contained in:
commit
f2876ea650
55 files changed
+183
-178
No files matched your search
+1
-1
@@ -5092,7 +5092,7 @@ Fent doble clic a qualsevol connector mostrarà informació sobre els ports.</tr
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5093,7 +5093,7 @@ Dvojitým kliknutím na kterýkoli z modulů se zobrazí informace o portech.</t
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -6637,7 +6637,7 @@ Doppelklicken auf eines der Plugins zeigt Informaitonen über die Ports an.</tra
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5074,7 +5074,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5075,7 +5075,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5074,7 +5074,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5107,7 +5107,7 @@ En double-cliquant sur ces greffons vous ferez apparaître des informations sur
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5106,7 +5106,7 @@ Facendo duplo clic sobre calquera dos engadidos mostra información sobre os por
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5109,7 +5109,7 @@ Facendo doppio click sui plugin verranno fornite informazioni sulle relative por
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5105,7 +5105,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5076,7 +5076,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5077,7 +5077,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5112,7 +5112,7 @@ Podwójne kliknięcie na którejkolwiek wtyczce otworzy okienko z informacjami o
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5400,7 +5400,7 @@ Clicando duas vezes com o mouse em qualquer plugin, voc6e terá informações so
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>Open in piano-roll</source>
|
||||
<translation>Abrir no Editor de Notas MIDI</translation>
|
||||
|
||||
+1
-1
@@ -5144,7 +5144,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5077,7 +5077,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
+1
-1
@@ -5079,7 +5079,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>patternView</name>
|
||||
<name>PatternView</name>
|
||||
<message>
|
||||
<source>double-click to open this pattern in piano-roll
|
||||
use mouse wheel to set volume of a step</source>
|
||||
|
||||
@@ -517,7 +517,7 @@ TrackContainerView QLabel
|
||||
/* Patterns */
|
||||
|
||||
/* instrument pattern */
|
||||
patternView {
|
||||
PatternView {
|
||||
color: rgb( 119, 199, 216 );
|
||||
qproperty-fgColor: rgb( 187, 227, 236 );
|
||||
qproperty-textColor: rgb( 255, 255, 255 );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* pattern.h - declaration of class pattern, which contains all informations
|
||||
* Pattern.h - declaration of class Pattern, which contains all information
|
||||
* about a pattern
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
@@ -46,7 +46,7 @@ class SampleBuffer;
|
||||
|
||||
|
||||
|
||||
class EXPORT pattern : public trackContentObject
|
||||
class EXPORT Pattern : public trackContentObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -56,9 +56,9 @@ public:
|
||||
MelodyPattern
|
||||
} ;
|
||||
|
||||
pattern( InstrumentTrack * _instrument_track );
|
||||
pattern( const pattern & _pat_to_copy );
|
||||
virtual ~pattern();
|
||||
Pattern( InstrumentTrack* instrumentTrack );
|
||||
Pattern( const Pattern& other );
|
||||
virtual ~Pattern();
|
||||
|
||||
void init();
|
||||
|
||||
@@ -137,14 +137,18 @@ private:
|
||||
NoteVector m_notes;
|
||||
int m_steps;
|
||||
|
||||
friend class patternView;
|
||||
friend class PatternView;
|
||||
friend class bbEditor;
|
||||
|
||||
|
||||
signals:
|
||||
void destroyedPattern( Pattern* );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class patternView : public trackContentObjectView
|
||||
class PatternView : public trackContentObjectView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -152,8 +156,8 @@ class patternView : public trackContentObjectView
|
||||
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
|
||||
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
|
||||
public:
|
||||
patternView( pattern * _pattern, trackView * _parent );
|
||||
virtual ~patternView();
|
||||
PatternView( Pattern* pattern, trackView* parent );
|
||||
virtual ~PatternView();
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -186,7 +190,7 @@ private:
|
||||
static QPixmap * s_stepBtnOff;
|
||||
static QPixmap * s_stepBtnOffLight;
|
||||
|
||||
pattern * m_pat;
|
||||
Pattern* m_pat;
|
||||
QPixmap m_paintPixmap;
|
||||
bool m_needsUpdate;
|
||||
} ;
|
||||
+8
-5
@@ -46,7 +46,7 @@ class QSignalMapper;
|
||||
|
||||
class comboBox;
|
||||
class NotePlayHandle;
|
||||
class pattern;
|
||||
class Pattern;
|
||||
class timeLine;
|
||||
class toolButton;
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
/*! \brief Resets settings to default when e.g. creating a new project */
|
||||
void reset();
|
||||
|
||||
void setCurrentPattern( pattern * _new_pattern );
|
||||
void setCurrentPattern( Pattern* newPattern );
|
||||
|
||||
inline void stopRecording()
|
||||
{
|
||||
@@ -73,12 +73,12 @@ public:
|
||||
return m_recording;
|
||||
}
|
||||
|
||||
inline const pattern * currentPattern() const
|
||||
const Pattern* currentPattern() const
|
||||
{
|
||||
return m_pattern;
|
||||
}
|
||||
|
||||
inline bool validPattern() const
|
||||
bool hasValidPattern() const
|
||||
{
|
||||
return m_pattern != NULL;
|
||||
}
|
||||
@@ -164,6 +164,9 @@ protected slots:
|
||||
void changeNoteEditMode( int i );
|
||||
void markSemiTone( int i );
|
||||
|
||||
void hidePattern( Pattern* pattern );
|
||||
|
||||
|
||||
signals:
|
||||
void currentPatternChanged();
|
||||
void semiToneMarkerMenuScaleSetEnabled(bool);
|
||||
@@ -291,7 +294,7 @@ private:
|
||||
|
||||
|
||||
|
||||
pattern * m_pattern;
|
||||
Pattern* m_pattern;
|
||||
QScrollBar * m_leftRightScroll;
|
||||
QScrollBar * m_topBottomScroll;
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "SampleBuffer.h"
|
||||
|
||||
class bbTrack;
|
||||
class pattern;
|
||||
class SampleTCO;
|
||||
class track;
|
||||
|
||||
|
||||
+3
-3
@@ -35,7 +35,7 @@
|
||||
#include "VstSyncController.h"
|
||||
|
||||
class AutomationTrack;
|
||||
class pattern;
|
||||
class Pattern;
|
||||
class timeLine;
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ public slots:
|
||||
void playAndRecord();
|
||||
void playTrack( track * _trackToPlay );
|
||||
void playBB();
|
||||
void playPattern( pattern * _patternToPlay, bool _loop = true );
|
||||
void playPattern( Pattern* patternToPlay, bool _loop = true );
|
||||
void togglePause();
|
||||
void stop();
|
||||
|
||||
@@ -354,7 +354,7 @@ private:
|
||||
tact_t m_length;
|
||||
|
||||
track * m_trackToPlay;
|
||||
pattern * m_patternToPlay;
|
||||
Pattern* m_patternToPlay;
|
||||
bool m_loopPattern;
|
||||
|
||||
double m_elapsedMilliSeconds;
|
||||
|
||||
@@ -14,7 +14,7 @@ ADD_SUBDIRECTORY(ladspa_browser)
|
||||
ADD_SUBDIRECTORY(LadspaEffect)
|
||||
ADD_SUBDIRECTORY(lb302)
|
||||
#ADD_SUBDIRECTORY(lb303)
|
||||
ADD_SUBDIRECTORY(midi_import)
|
||||
ADD_SUBDIRECTORY(MidiImport)
|
||||
ADD_SUBDIRECTORY(monstro)
|
||||
ADD_SUBDIRECTORY(nes)
|
||||
ADD_SUBDIRECTORY(opl2)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "note.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "track.h"
|
||||
#include "bb_track.h"
|
||||
#include "bb_track_container.h"
|
||||
@@ -270,7 +270,7 @@ bool HydrogenImport::readSong()
|
||||
QString instrId = LocalFileMng::readXmlString( noteNode, "instrument", 0,false, false );
|
||||
int i = pattern_count - 1 + nbb;
|
||||
pattern_id[sName] = pattern_count - 1;
|
||||
pattern *p = dynamic_cast<pattern *>( drum_track[instrId]->getTCO( i ) );
|
||||
Pattern*p = dynamic_cast<Pattern*>( drum_track[instrId]->getTCO( i ) );
|
||||
note n;
|
||||
n.setPos( nPosition );
|
||||
if ( (nPosition + 48) <= nSize )
|
||||
|
||||
File renamed without changes.
@@ -35,7 +35,7 @@
|
||||
#include "AutomationTrack.h"
|
||||
#include "AutomationPattern.h"
|
||||
#include "config_mgr.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "Instrument.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MidiTime.h"
|
||||
@@ -209,7 +209,7 @@ public:
|
||||
{ }
|
||||
|
||||
InstrumentTrack * it;
|
||||
pattern * p;
|
||||
Pattern* p;
|
||||
Instrument * it_inst;
|
||||
bool isSF2;
|
||||
bool hasNotes;
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
if( !p || n.pos() > lastEnd + DefaultTicksPerTact )
|
||||
{
|
||||
MidiTime pPos = MidiTime( n.pos().getTact(), 0 );
|
||||
p = dynamic_cast<pattern *>( it->createTCO( 0 ) );
|
||||
p = dynamic_cast<Pattern*>( it->createTCO( 0 ) );
|
||||
p->movePosition( pPos );
|
||||
}
|
||||
hasNotes = true;
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -48,7 +48,7 @@
|
||||
#include "EnvelopeAndLfoParameters.h"
|
||||
#include "knob.h"
|
||||
#include "Oscillator.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "Piano.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "project_notes.h"
|
||||
@@ -1542,8 +1542,7 @@ else
|
||||
{
|
||||
const int pat = *jt / 256;
|
||||
const int pos = *jt % 256;
|
||||
pattern * p =
|
||||
dynamic_cast<pattern *>( t->getTCO( pat ) );
|
||||
Pattern* p = dynamic_cast<Pattern*>( t->getTCO( pat ) );
|
||||
if( p == NULL )
|
||||
{
|
||||
continue;
|
||||
@@ -1567,7 +1566,7 @@ else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
pattern * p = dynamic_cast<pattern *>( t->getTCO( pat ) );
|
||||
Pattern* p = dynamic_cast<Pattern*>( t->getTCO( pat ) );
|
||||
if( p != NULL )
|
||||
{
|
||||
p->addNote( jt->second, false );
|
||||
|
||||
@@ -40,7 +40,7 @@ ENDIF(LMMS_HOST_X86_64)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp"
|
||||
COMMAND ${WINE_CXX}
|
||||
ARGS "-I\"${CMAKE_BINARY_DIR}\"" "-I\"${CMAKE_SOURCE_DIR}/include\"" "-I\"${CMAKE_INSTALL_PREFIX}/include/wine/windows\"" "-I\"${CMAKE_INSTALL_PREFIX}/include\"" -I/usr/include/wine/windows "\"${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp\"" -mwindows -lpthread ${EXTRA_FLAGS} -o RemoteVstPlugin
|
||||
ARGS "-I\"${CMAKE_BINARY_DIR}\"" "-I\"${CMAKE_SOURCE_DIR}/include\"" "-I\"${CMAKE_INSTALL_PREFIX}/include/wine/windows\"" "-I\"${CMAKE_INSTALL_PREFIX}/include\"" -I/usr/include/wine/windows "\"${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp\"" -ansi -mwindows -lpthread ${EXTRA_FLAGS} -o RemoteVstPlugin
|
||||
COMMAND find -name RemoteVstPlugin.exe -exec mv "'{}'" RemoteVstPlugin "';'"
|
||||
TARGET vstbase
|
||||
OUTPUTS RemoteVstPlugin
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "bb_track.h"
|
||||
#include "engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "SampleBuffer.h"
|
||||
#include "SampleTrack.h"
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "bb_track.h"
|
||||
#include "engine.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "SampleBuffer.h"
|
||||
#include "SampleTrack.h"
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@
|
||||
#include "ladspa_2_lmms.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Mixer.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "PresetPreviewPlayHandle.h"
|
||||
#include "ProjectJournal.h"
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@
|
||||
#include "MidiClient.h"
|
||||
#include "DataFile.h"
|
||||
#include "NotePlayHandle.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "PianoRoll.h"
|
||||
#include "ProjectJournal.h"
|
||||
#include "project_notes.h"
|
||||
@@ -473,14 +473,14 @@ void song::playBB()
|
||||
|
||||
|
||||
|
||||
void song::playPattern( pattern * _patternToPlay, bool _loop )
|
||||
void song::playPattern( Pattern* patternToPlay, bool _loop )
|
||||
{
|
||||
if( isStopped() == false )
|
||||
{
|
||||
stop();
|
||||
}
|
||||
|
||||
m_patternToPlay = _patternToPlay;
|
||||
m_patternToPlay = patternToPlay;
|
||||
m_loopPattern = _loop;
|
||||
|
||||
if( m_patternToPlay != NULL )
|
||||
|
||||
@@ -1932,7 +1932,7 @@ void AutomationEditor::play()
|
||||
if( engine::getSong()->playMode() != song::Mode_PlayPattern )
|
||||
{
|
||||
engine::getSong()->stop();
|
||||
engine::getSong()->playPattern( (pattern *) engine::pianoRoll()->currentPattern() );
|
||||
engine::getSong()->playPattern( (Pattern *) engine::pianoRoll()->currentPattern() );
|
||||
}
|
||||
else if( engine::getSong()->isStopped() == false )
|
||||
{
|
||||
@@ -1940,7 +1940,7 @@ void AutomationEditor::play()
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getSong()->playPattern( (pattern *) engine::pianoRoll()->currentPattern() );
|
||||
engine::getSong()->playPattern( (Pattern *) engine::pianoRoll()->currentPattern() );
|
||||
}
|
||||
}
|
||||
else if( inBBEditor() )
|
||||
|
||||
+52
-32
@@ -58,7 +58,7 @@
|
||||
#include "MainWindow.h"
|
||||
#include "MidiEvent.h"
|
||||
#include "DataFile.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "Piano.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "song.h"
|
||||
@@ -787,19 +787,27 @@ PianoRoll::~PianoRoll()
|
||||
}
|
||||
|
||||
|
||||
void PianoRoll::setCurrentPattern( pattern * _new_pattern )
|
||||
void PianoRoll::setCurrentPattern( Pattern* newPattern )
|
||||
{
|
||||
if( validPattern() )
|
||||
if( hasValidPattern() )
|
||||
{
|
||||
m_pattern->instrumentTrack()->disconnect( this );
|
||||
}
|
||||
|
||||
m_pattern = _new_pattern;
|
||||
// force the song-editor to stop playing if it played pattern before
|
||||
if( engine::getSong()->isPlaying() &&
|
||||
engine::getSong()->playMode() == song::Mode_PlayPattern )
|
||||
{
|
||||
engine::getSong()->playPattern( NULL );
|
||||
}
|
||||
|
||||
// set new data
|
||||
m_pattern = newPattern;
|
||||
m_currentPosition = 0;
|
||||
m_currentNote = NULL;
|
||||
m_startKey = INITIAL_START_KEY;
|
||||
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
//resizeEvent( NULL );
|
||||
setWindowTitle( tr( "Piano-Roll - no pattern" ) );
|
||||
@@ -840,6 +848,9 @@ void PianoRoll::setCurrentPattern( pattern * _new_pattern )
|
||||
// of start-notes and so on...)
|
||||
resizeEvent( NULL );
|
||||
|
||||
// make sure to always get informed about the pattern being destroyed
|
||||
connect( m_pattern, SIGNAL( destroyedPattern( Pattern* ) ), this, SLOT( hidePattern( Pattern* ) ) );
|
||||
|
||||
connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOn( const note& ) ), this, SLOT( startRecordNote( const note& ) ) );
|
||||
connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOff( const note& ) ), this, SLOT( finishRecordNote( const note& ) ) );
|
||||
connect( m_pattern->instrumentTrack()->pianoModel(), SIGNAL( dataChanged() ), this, SLOT( update() ) );
|
||||
@@ -852,6 +863,15 @@ void PianoRoll::setCurrentPattern( pattern * _new_pattern )
|
||||
|
||||
|
||||
|
||||
void PianoRoll::hidePattern( Pattern* pattern )
|
||||
{
|
||||
if( m_pattern == pattern )
|
||||
{
|
||||
setCurrentPattern( NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PianoRoll::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
@@ -1192,7 +1212,7 @@ int PianoRoll::selectionCount() const // how many notes are selected?
|
||||
|
||||
void PianoRoll::keyPressEvent( QKeyEvent* event )
|
||||
{
|
||||
if( validPattern() && event->modifiers() == Qt::NoModifier )
|
||||
if( hasValidPattern() && event->modifiers() == Qt::NoModifier )
|
||||
{
|
||||
const int key_num = PianoView::getKeyFromKeyEvent( event ) + ( DefaultOctave - 1 ) * KeysPerOctave;
|
||||
|
||||
@@ -1468,7 +1488,7 @@ void PianoRoll::keyPressEvent( QKeyEvent* event )
|
||||
|
||||
void PianoRoll::keyReleaseEvent( QKeyEvent* event )
|
||||
{
|
||||
if( validPattern() && event->modifiers() == Qt::NoModifier )
|
||||
if( hasValidPattern() && event->modifiers() == Qt::NoModifier )
|
||||
{
|
||||
const int key_num = PianoView::getKeyFromKeyEvent( event ) + ( DefaultOctave - 1 ) * KeysPerOctave;
|
||||
|
||||
@@ -1490,7 +1510,7 @@ void PianoRoll::keyReleaseEvent( QKeyEvent* event )
|
||||
// update after undo/redo
|
||||
case Qt::Key_Z:
|
||||
case Qt::Key_R:
|
||||
if( validPattern() && event->modifiers() == Qt::ControlModifier )
|
||||
if( hasValidPattern() && event->modifiers() == Qt::ControlModifier )
|
||||
{
|
||||
update();
|
||||
}
|
||||
@@ -1570,7 +1590,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
m_startedWithShift = _me->modifiers() & Qt::ShiftModifier;
|
||||
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1684,7 +1704,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
is_new_note = true;
|
||||
m_pattern->addJournalCheckPoint();
|
||||
m_pattern->setType( pattern::MelodyPattern );
|
||||
m_pattern->setType( Pattern::MelodyPattern );
|
||||
|
||||
// then set new note
|
||||
|
||||
@@ -1952,7 +1972,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void PianoRoll::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -2114,7 +2134,7 @@ void PianoRoll::computeSelectedNotes(bool shift)
|
||||
}
|
||||
|
||||
//int y_base = noteEditTop() - 1;
|
||||
if( validPattern() == true )
|
||||
if( hasValidPattern() == true )
|
||||
{
|
||||
const NoteVector & notes = m_pattern->notes();
|
||||
|
||||
@@ -2216,7 +2236,7 @@ void PianoRoll::mouseReleaseEvent( QMouseEvent * _me )
|
||||
}
|
||||
|
||||
|
||||
if( validPattern() == true )
|
||||
if( hasValidPattern() == true )
|
||||
{
|
||||
// turn off all notes that are playing
|
||||
const NoteVector & notes = m_pattern->notes();
|
||||
@@ -2257,7 +2277,7 @@ void PianoRoll::mouseReleaseEvent( QMouseEvent * _me )
|
||||
|
||||
void PianoRoll::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
update();
|
||||
return;
|
||||
@@ -3011,7 +3031,7 @@ void PianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
if( prKeyOrder[key % KeysPerOctave] == PR_WHITE_KEY_SMALL )
|
||||
{
|
||||
// draw a small one while checking if it is pressed or not
|
||||
if( validPattern() && m_pattern->instrumentTrack()->pianoModel()->isKeyPressed( key ) )
|
||||
if( hasValidPattern() && m_pattern->instrumentTrack()->pianoModel()->isKeyPressed( key ) )
|
||||
{
|
||||
p.drawPixmap( PIANO_X, y - WHITE_KEY_SMALL_HEIGHT, *s_whiteKeySmallPressedPm );
|
||||
}
|
||||
@@ -3027,7 +3047,7 @@ void PianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
PR_WHITE_KEY_BIG )
|
||||
{
|
||||
// draw a big one while checking if it is pressed or not
|
||||
if( validPattern() && m_pattern->instrumentTrack()->pianoModel()->isKeyPressed( key ) )
|
||||
if( hasValidPattern() && m_pattern->instrumentTrack()->pianoModel()->isKeyPressed( key ) )
|
||||
{
|
||||
p.drawPixmap( PIANO_X, y - WHITE_KEY_BIG_HEIGHT, *s_whiteKeyBigPressedPm );
|
||||
}
|
||||
@@ -3100,7 +3120,7 @@ void PianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
// then draw it (calculation of y very complicated,
|
||||
// but that's the only working solution, sorry...)
|
||||
// check if the key is pressed or not
|
||||
if( validPattern() && m_pattern->instrumentTrack()->pianoModel()->isKeyPressed( key ) )
|
||||
if( hasValidPattern() && m_pattern->instrumentTrack()->pianoModel()->isKeyPressed( key ) )
|
||||
{
|
||||
p.drawPixmap( PIANO_X, y - ( first_white_key_height -
|
||||
WHITE_KEY_SMALL_HEIGHT ) -
|
||||
@@ -3237,7 +3257,7 @@ void PianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
}
|
||||
|
||||
int y_base = keyAreaBottom() - 1;
|
||||
if( validPattern() == true )
|
||||
if( hasValidPattern() == true )
|
||||
{
|
||||
p.setClipRect( WHITE_KEY_WIDTH, PR_TOP_MARGIN,
|
||||
width() - WHITE_KEY_WIDTH,
|
||||
@@ -3371,7 +3391,7 @@ void PianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
p.drawRect( x + WHITE_KEY_WIDTH, y, w, h );
|
||||
|
||||
// TODO: Get this out of paint event
|
||||
int l = ( validPattern() == true )? (int) m_pattern->length() : 0;
|
||||
int l = ( hasValidPattern() == true )? (int) m_pattern->length() : 0;
|
||||
|
||||
// reset scroll-range
|
||||
if( m_leftRightScroll->maximum() != l )
|
||||
@@ -3384,7 +3404,7 @@ void PianoRoll::paintEvent( QPaintEvent * _pe )
|
||||
horizCol.setAlpha( 64 );
|
||||
|
||||
// horizontal line for the key under the cursor
|
||||
if( validPattern() == true )
|
||||
if( hasValidPattern() == true )
|
||||
{
|
||||
int key_num = getKey( mapFromGlobal( QCursor::pos() ).y() );
|
||||
p.fillRect( 10, keyAreaBottom() + 3 - KEY_LINE_HEIGHT *
|
||||
@@ -3640,7 +3660,7 @@ song::PlayModes PianoRoll::desiredPlayModeForAccompany() const
|
||||
|
||||
void PianoRoll::play()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3664,7 +3684,7 @@ void PianoRoll::record()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
if( m_recording == true || validPattern() == false )
|
||||
if( m_recording == true || hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3683,7 +3703,7 @@ void PianoRoll::recordAccompany()
|
||||
{
|
||||
stop();
|
||||
}
|
||||
if( m_recording == true || validPattern() == false )
|
||||
if( m_recording == true || hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3716,7 +3736,7 @@ void PianoRoll::stop()
|
||||
|
||||
void PianoRoll::startRecordNote( const note & _n )
|
||||
{
|
||||
if( m_recording == true && validPattern() == true &&
|
||||
if( m_recording == true && hasValidPattern() == true &&
|
||||
engine::getSong()->isPlaying() &&
|
||||
( engine::getSong()->playMode() ==
|
||||
desiredPlayModeForAccompany() ||
|
||||
@@ -3743,7 +3763,7 @@ void PianoRoll::startRecordNote( const note & _n )
|
||||
|
||||
void PianoRoll::finishRecordNote( const note & _n )
|
||||
{
|
||||
if( m_recording == true && validPattern() == true &&
|
||||
if( m_recording == true && hasValidPattern() == true &&
|
||||
engine::getSong()->isPlaying() &&
|
||||
( engine::getSong()->playMode() ==
|
||||
desiredPlayModeForAccompany() ||
|
||||
@@ -3828,7 +3848,7 @@ void PianoRoll::detuneButtonToggled()
|
||||
|
||||
void PianoRoll::selectAll()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3886,7 +3906,7 @@ void PianoRoll::selectAll()
|
||||
// returns vector with pointers to all selected notes
|
||||
void PianoRoll::getSelectedNotes( NoteVector & _selected_notes )
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -3989,7 +4009,7 @@ void PianoRoll::copySelectedNotes()
|
||||
|
||||
void PianoRoll::cutSelectedNotes()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4021,7 +4041,7 @@ void PianoRoll::cutSelectedNotes()
|
||||
|
||||
void PianoRoll::pasteNotes()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4073,7 +4093,7 @@ void PianoRoll::pasteNotes()
|
||||
|
||||
void PianoRoll::deleteSelectedNotes()
|
||||
{
|
||||
if( validPattern() == false )
|
||||
if( hasValidPattern() == false )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4156,7 +4176,7 @@ void PianoRoll::updatePositionAccompany( const MidiTime & _t )
|
||||
{
|
||||
song * s = engine::getSong();
|
||||
|
||||
if( m_recording && validPattern() &&
|
||||
if( m_recording && hasValidPattern() &&
|
||||
s->playMode() != song::Mode_PlayPattern )
|
||||
{
|
||||
MidiTime pos = _t;
|
||||
@@ -4248,7 +4268,7 @@ MidiTime PianoRoll::newNoteLen() const
|
||||
|
||||
bool PianoRoll::mouseOverNote()
|
||||
{
|
||||
return validPattern() && noteUnderMouse() != NULL;
|
||||
return hasValidPattern() && noteUnderMouse() != NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "string_pair_drag.h"
|
||||
|
||||
#include "TrackContainer.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
|
||||
|
||||
|
||||
@@ -256,8 +256,7 @@ void bbEditor::addSteps()
|
||||
{
|
||||
if( ( *it )->type() == track::InstrumentTrack )
|
||||
{
|
||||
pattern * p = static_cast<pattern *>(
|
||||
( *it )->getTCO( m_bbtc->currentBB() ) );
|
||||
Pattern* p = static_cast<Pattern *>( ( *it )->getTCO( m_bbtc->currentBB() ) );
|
||||
p->addSteps();
|
||||
}
|
||||
}
|
||||
@@ -275,8 +274,7 @@ void bbEditor::removeSteps()
|
||||
{
|
||||
if( ( *it )->type() == track::InstrumentTrack )
|
||||
{
|
||||
pattern * p = static_cast<pattern *>(
|
||||
( *it )->getTCO( m_bbtc->currentBB() ) );
|
||||
Pattern* p = static_cast<Pattern *>( ( *it )->getTCO( m_bbtc->currentBB() ) );
|
||||
p->removeSteps();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#include "MixHelpers.h"
|
||||
#include "DataFile.h"
|
||||
#include "NotePlayHandle.h"
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "PluginView.h"
|
||||
#include "SamplePlayHandle.h"
|
||||
#include "song.h"
|
||||
@@ -514,7 +514,7 @@ void InstrumentTrack::setName( const QString & _new_name )
|
||||
// which have the same name as the instrument-track
|
||||
for( int i = 0; i < numOfTCOs(); ++i )
|
||||
{
|
||||
pattern * p = dynamic_cast<pattern *>( getTCO( i ) );
|
||||
Pattern* p = dynamic_cast<Pattern*>( getTCO( i ) );
|
||||
if( ( p != NULL && p->name() == name() ) || p->name() == "" )
|
||||
{
|
||||
p->setName( _new_name );
|
||||
@@ -630,7 +630,7 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames,
|
||||
|
||||
for( tcoVector::Iterator it = tcos.begin(); it != tcos.end(); ++it )
|
||||
{
|
||||
pattern * p = dynamic_cast<pattern *>( *it );
|
||||
Pattern* p = dynamic_cast<Pattern*>( *it );
|
||||
// everything which is not a pattern or muted won't be played
|
||||
if( p == NULL || ( *it )->isMuted() )
|
||||
{
|
||||
@@ -695,7 +695,7 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames,
|
||||
|
||||
trackContentObject * InstrumentTrack::createTCO( const MidiTime & )
|
||||
{
|
||||
return new pattern( this );
|
||||
return new Pattern( this );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <QPushButton>
|
||||
#include <QtAlgorithms>
|
||||
|
||||
#include "pattern.h"
|
||||
#include "Pattern.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "templates.h"
|
||||
#include "gui_templates.h"
|
||||
@@ -51,14 +51,14 @@
|
||||
#include "MainWindow.h"
|
||||
|
||||
|
||||
QPixmap * patternView::s_stepBtnOn = NULL;
|
||||
QPixmap * patternView::s_stepBtnOverlay = NULL;
|
||||
QPixmap * patternView::s_stepBtnOff = NULL;
|
||||
QPixmap * patternView::s_stepBtnOffLight = NULL;
|
||||
QPixmap * PatternView::s_stepBtnOn = NULL;
|
||||
QPixmap * PatternView::s_stepBtnOverlay = NULL;
|
||||
QPixmap * PatternView::s_stepBtnOff = NULL;
|
||||
QPixmap * PatternView::s_stepBtnOffLight = NULL;
|
||||
|
||||
|
||||
|
||||
pattern::pattern( InstrumentTrack * _instrument_track ) :
|
||||
Pattern::Pattern( InstrumentTrack * _instrument_track ) :
|
||||
trackContentObject( _instrument_track ),
|
||||
m_instrumentTrack( _instrument_track ),
|
||||
m_patternType( BeatPattern ),
|
||||
@@ -71,14 +71,13 @@ pattern::pattern( InstrumentTrack * _instrument_track ) :
|
||||
|
||||
|
||||
|
||||
pattern::pattern( const pattern & _pat_to_copy ) :
|
||||
trackContentObject( _pat_to_copy.m_instrumentTrack ),
|
||||
m_instrumentTrack( _pat_to_copy.m_instrumentTrack ),
|
||||
m_patternType( _pat_to_copy.m_patternType ),
|
||||
m_steps( _pat_to_copy.m_steps )
|
||||
Pattern::Pattern( const Pattern& other ) :
|
||||
trackContentObject( other.m_instrumentTrack ),
|
||||
m_instrumentTrack( other.m_instrumentTrack ),
|
||||
m_patternType( other.m_patternType ),
|
||||
m_steps( other.m_steps )
|
||||
{
|
||||
for( NoteVector::ConstIterator it = _pat_to_copy.m_notes.begin();
|
||||
it != _pat_to_copy.m_notes.end(); ++it )
|
||||
for( NoteVector::ConstIterator it = other.m_notes.begin(); it != other.m_notes.end(); ++it )
|
||||
{
|
||||
m_notes.push_back( new note( **it ) );
|
||||
}
|
||||
@@ -87,8 +86,10 @@ pattern::pattern( const pattern & _pat_to_copy ) :
|
||||
}
|
||||
|
||||
|
||||
pattern::~pattern()
|
||||
Pattern::~Pattern()
|
||||
{
|
||||
emit destroyedPattern( this );
|
||||
|
||||
for( NoteVector::Iterator it = m_notes.begin();
|
||||
it != m_notes.end(); ++it )
|
||||
{
|
||||
@@ -101,7 +102,7 @@ pattern::~pattern()
|
||||
|
||||
|
||||
|
||||
void pattern::init()
|
||||
void Pattern::init()
|
||||
{
|
||||
connect( engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ),
|
||||
this, SLOT( changeTimeSignature() ) );
|
||||
@@ -116,7 +117,7 @@ void pattern::init()
|
||||
|
||||
|
||||
|
||||
MidiTime pattern::length() const
|
||||
MidiTime Pattern::length() const
|
||||
{
|
||||
if( m_patternType == BeatPattern )
|
||||
{
|
||||
@@ -141,7 +142,7 @@ MidiTime pattern::length() const
|
||||
|
||||
|
||||
|
||||
MidiTime pattern::beatPatternLength() const
|
||||
MidiTime Pattern::beatPatternLength() const
|
||||
{
|
||||
tick_t max_length = MidiTime::ticksPerTact();
|
||||
|
||||
@@ -166,7 +167,7 @@ MidiTime pattern::beatPatternLength() const
|
||||
return MidiTime( max_length ).nextFullTact() * MidiTime::ticksPerTact();
|
||||
}
|
||||
|
||||
note * pattern::addNote( const note & _new_note, const bool _quant_pos )
|
||||
note * Pattern::addNote( const note & _new_note, const bool _quant_pos )
|
||||
{
|
||||
note * new_note = new note( _new_note );
|
||||
if( _quant_pos && engine::pianoRoll() )
|
||||
@@ -212,7 +213,7 @@ note * pattern::addNote( const note & _new_note, const bool _quant_pos )
|
||||
|
||||
|
||||
|
||||
void pattern::removeNote( const note * _note_to_del )
|
||||
void Pattern::removeNote( const note * _note_to_del )
|
||||
{
|
||||
instrumentTrack()->lock();
|
||||
NoteVector::Iterator it = m_notes.begin();
|
||||
@@ -239,7 +240,7 @@ void pattern::removeNote( const note * _note_to_del )
|
||||
|
||||
// returns a pointer to the note at specified step, or NULL if note doesn't exist
|
||||
|
||||
note * pattern::noteAtStep( int _step )
|
||||
note * Pattern::noteAtStep( int _step )
|
||||
{
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end();
|
||||
++it )
|
||||
@@ -253,7 +254,7 @@ note * pattern::noteAtStep( int _step )
|
||||
}
|
||||
|
||||
|
||||
note * pattern::rearrangeNote( const note * _note_to_proc,
|
||||
note * Pattern::rearrangeNote( const note * _note_to_proc,
|
||||
const bool _quant_pos )
|
||||
{
|
||||
// just rearrange the position of the note by removing it and adding
|
||||
@@ -266,7 +267,7 @@ note * pattern::rearrangeNote( const note * _note_to_proc,
|
||||
|
||||
|
||||
|
||||
void pattern::rearrangeAllNotes()
|
||||
void Pattern::rearrangeAllNotes()
|
||||
{
|
||||
// sort notes by start time
|
||||
qSort(m_notes.begin(), m_notes.end(), note::lessThan );
|
||||
@@ -274,7 +275,7 @@ void pattern::rearrangeAllNotes()
|
||||
|
||||
|
||||
|
||||
void pattern::clearNotes()
|
||||
void Pattern::clearNotes()
|
||||
{
|
||||
instrumentTrack()->lock();
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end();
|
||||
@@ -292,7 +293,7 @@ void pattern::clearNotes()
|
||||
|
||||
|
||||
|
||||
void pattern::setStep( int _step, bool _enabled )
|
||||
void Pattern::setStep( int _step, bool _enabled )
|
||||
{
|
||||
for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end();
|
||||
++it )
|
||||
@@ -309,7 +310,7 @@ void pattern::setStep( int _step, bool _enabled )
|
||||
|
||||
|
||||
|
||||
void pattern::setType( PatternTypes _new_pattern_type )
|
||||
void Pattern::setType( PatternTypes _new_pattern_type )
|
||||
{
|
||||
if( _new_pattern_type == BeatPattern ||
|
||||
_new_pattern_type == MelodyPattern )
|
||||
@@ -321,25 +322,25 @@ void pattern::setType( PatternTypes _new_pattern_type )
|
||||
|
||||
|
||||
|
||||
void pattern::checkType()
|
||||
void Pattern::checkType()
|
||||
{
|
||||
NoteVector::Iterator it = m_notes.begin();
|
||||
while( it != m_notes.end() )
|
||||
{
|
||||
if( ( *it )->length() > 0 )
|
||||
{
|
||||
setType( pattern::MelodyPattern );
|
||||
setType( Pattern::MelodyPattern );
|
||||
return;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
setType( pattern::BeatPattern );
|
||||
setType( Pattern::BeatPattern );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
void Pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "type", m_patternType );
|
||||
_this.setAttribute( "name", name() );
|
||||
@@ -373,7 +374,7 @@ void pattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void pattern::loadSettings( const QDomElement & _this )
|
||||
void Pattern::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_patternType = static_cast<PatternTypes>( _this.attribute( "type"
|
||||
).toInt() );
|
||||
@@ -420,7 +421,7 @@ void pattern::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void pattern::clear()
|
||||
void Pattern::clear()
|
||||
{
|
||||
addJournalCheckPoint();
|
||||
clearNotes();
|
||||
@@ -430,7 +431,7 @@ void pattern::clear()
|
||||
|
||||
|
||||
|
||||
void pattern::addSteps()
|
||||
void Pattern::addSteps()
|
||||
{
|
||||
m_steps += MidiTime::stepsPerTact();
|
||||
ensureBeatNotes();
|
||||
@@ -441,7 +442,7 @@ void pattern::addSteps()
|
||||
|
||||
|
||||
|
||||
void pattern::removeSteps()
|
||||
void Pattern::removeSteps()
|
||||
{
|
||||
int _n = MidiTime::stepsPerTact();
|
||||
if( _n < m_steps )
|
||||
@@ -470,16 +471,16 @@ void pattern::removeSteps()
|
||||
|
||||
|
||||
|
||||
trackContentObjectView * pattern::createView( trackView * _tv )
|
||||
trackContentObjectView * Pattern::createView( trackView * _tv )
|
||||
{
|
||||
return new patternView( this, _tv );
|
||||
return new PatternView( this, _tv );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void pattern::ensureBeatNotes()
|
||||
void Pattern::ensureBeatNotes()
|
||||
{
|
||||
// make sure, that all step-note exist
|
||||
for( int i = 0; i < m_steps; ++i )
|
||||
@@ -531,7 +532,7 @@ void pattern::ensureBeatNotes()
|
||||
|
||||
|
||||
|
||||
void pattern::updateBBTrack()
|
||||
void Pattern::updateBBTrack()
|
||||
{
|
||||
if( getTrack()->trackContainer() == engine::getBBTrackContainer() )
|
||||
{
|
||||
@@ -547,7 +548,7 @@ void pattern::updateBBTrack()
|
||||
|
||||
|
||||
|
||||
bool pattern::empty()
|
||||
bool Pattern::empty()
|
||||
{
|
||||
for( NoteVector::ConstIterator it = m_notes.begin();
|
||||
it != m_notes.end(); ++it )
|
||||
@@ -563,7 +564,7 @@ bool pattern::empty()
|
||||
|
||||
|
||||
|
||||
void pattern::changeTimeSignature()
|
||||
void Pattern::changeTimeSignature()
|
||||
{
|
||||
MidiTime last_pos = MidiTime::ticksPerTact();
|
||||
for( NoteVector::ConstIterator cit = m_notes.begin();
|
||||
@@ -600,9 +601,9 @@ void pattern::changeTimeSignature()
|
||||
|
||||
|
||||
|
||||
patternView::patternView( pattern * _pattern, trackView * _parent ) :
|
||||
trackContentObjectView( _pattern, _parent ),
|
||||
m_pat( _pattern ),
|
||||
PatternView::PatternView( Pattern* pattern, trackView* parent ) :
|
||||
trackContentObjectView( pattern, parent ),
|
||||
m_pat( pattern ),
|
||||
m_paintPixmap(),
|
||||
m_needsUpdate( true )
|
||||
{
|
||||
@@ -647,29 +648,15 @@ patternView::patternView( pattern * _pattern, trackView * _parent ) :
|
||||
|
||||
|
||||
|
||||
patternView::~patternView()
|
||||
PatternView::~PatternView()
|
||||
{
|
||||
if( engine::pianoRoll()->currentPattern() == m_pat )
|
||||
{
|
||||
engine::pianoRoll()->disconnect( this );
|
||||
|
||||
engine::pianoRoll()->setCurrentPattern( NULL );
|
||||
// we have to have the song-editor to stop playing if it played
|
||||
// us before
|
||||
if( engine::getSong()->isPlaying() &&
|
||||
engine::getSong()->playMode() ==
|
||||
song::Mode_PlayPattern )
|
||||
{
|
||||
engine::getSong()->playPattern( NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void patternView::update()
|
||||
void PatternView::update()
|
||||
{
|
||||
m_needsUpdate = true;
|
||||
m_pat->changeLength( m_pat->length() );
|
||||
@@ -679,7 +666,7 @@ void patternView::update()
|
||||
|
||||
|
||||
|
||||
void patternView::openInPianoRoll()
|
||||
void PatternView::openInPianoRoll()
|
||||
{
|
||||
engine::pianoRoll()->setCurrentPattern( m_pat );
|
||||
engine::pianoRoll()->parentWidget()->show();
|
||||
@@ -689,7 +676,7 @@ void patternView::openInPianoRoll()
|
||||
|
||||
|
||||
|
||||
void patternView::resetName()
|
||||
void PatternView::resetName()
|
||||
{
|
||||
m_pat->setName( m_pat->m_instrumentTrack->name() );
|
||||
}
|
||||
@@ -697,7 +684,7 @@ void patternView::resetName()
|
||||
|
||||
|
||||
|
||||
void patternView::changeName()
|
||||
void PatternView::changeName()
|
||||
{
|
||||
QString s = m_pat->name();
|
||||
renameDialog rename_dlg( s );
|
||||
@@ -708,7 +695,7 @@ void patternView::changeName()
|
||||
|
||||
|
||||
|
||||
void patternView::constructContextMenu( QMenu * _cm )
|
||||
void PatternView::constructContextMenu( QMenu * _cm )
|
||||
{
|
||||
QAction * a = new QAction( embed::getIconPixmap( "piano" ),
|
||||
tr( "Open in piano-roll" ), _cm );
|
||||
@@ -739,15 +726,15 @@ void patternView::constructContextMenu( QMenu * _cm )
|
||||
|
||||
|
||||
|
||||
void patternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
void PatternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() != Qt::LeftButton )
|
||||
{
|
||||
_me->ignore();
|
||||
return;
|
||||
}
|
||||
if( m_pat->type() == pattern::MelodyPattern ||
|
||||
!( m_pat->type() == pattern::BeatPattern &&
|
||||
if( m_pat->type() == Pattern::MelodyPattern ||
|
||||
!( m_pat->type() == Pattern::BeatPattern &&
|
||||
( pixelsPerTact() >= 192 ||
|
||||
m_pat->m_steps != MidiTime::stepsPerTact() ) &&
|
||||
_me->y() > height() - s_stepBtnOff->height() ) )
|
||||
@@ -759,10 +746,10 @@ void patternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void patternView::mousePressEvent( QMouseEvent * _me )
|
||||
void PatternView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
m_pat->m_patternType == pattern::BeatPattern &&
|
||||
m_pat->m_patternType == Pattern::BeatPattern &&
|
||||
( fixedTCOs() || pixelsPerTact() >= 96 ||
|
||||
m_pat->m_steps != MidiTime::stepsPerTact() ) &&
|
||||
_me->y() > height() - s_stepBtnOff->height() )
|
||||
@@ -831,9 +818,9 @@ void patternView::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
|
||||
|
||||
void patternView::wheelEvent( QWheelEvent * _we )
|
||||
void PatternView::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
if( m_pat->m_patternType == pattern::BeatPattern &&
|
||||
if( m_pat->m_patternType == Pattern::BeatPattern &&
|
||||
( fixedTCOs() || pixelsPerTact() >= 96 ||
|
||||
m_pat->m_steps != MidiTime::stepsPerTact() ) &&
|
||||
_we->y() > height() - s_stepBtnOff->height() )
|
||||
@@ -891,7 +878,7 @@ void patternView::wheelEvent( QWheelEvent * _we )
|
||||
|
||||
|
||||
|
||||
void patternView::paintEvent( QPaintEvent * )
|
||||
void PatternView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
if( m_needsUpdate == false )
|
||||
{
|
||||
@@ -918,14 +905,14 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
|
||||
QColor c;
|
||||
|
||||
if(( m_pat->m_patternType != pattern::BeatPattern ) &&
|
||||
if(( m_pat->m_patternType != Pattern::BeatPattern ) &&
|
||||
!( m_pat->getTrack()->isMuted() || m_pat->isMuted() ))
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: styleColor;
|
||||
else
|
||||
c = QColor( 80, 80, 80 );
|
||||
|
||||
if( m_pat->m_patternType != pattern::BeatPattern )
|
||||
if( m_pat->m_patternType != Pattern::BeatPattern )
|
||||
{
|
||||
lingrad.setColorAt( 1, c.darker( 300 ) );
|
||||
lingrad.setColorAt( 0, c );
|
||||
@@ -937,14 +924,14 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
p.setBrush( lingrad );
|
||||
if( engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != pattern::BeatPattern )
|
||||
if( engine::pianoRoll()->currentPattern() == m_pat && m_pat->m_patternType != Pattern::BeatPattern )
|
||||
p.setPen( c.lighter( 130 ) );
|
||||
else
|
||||
p.setPen( c.darker( 300 ) );
|
||||
p.drawRect( QRect( 0, 0, width() - 1, height() - 1 ) );
|
||||
|
||||
p.setBrush( QBrush() );
|
||||
if( m_pat->m_patternType != pattern::BeatPattern )
|
||||
if( m_pat->m_patternType != Pattern::BeatPattern )
|
||||
{
|
||||
if( engine::pianoRoll()->currentPattern() == m_pat )
|
||||
p.setPen( c.lighter( 160 ) );
|
||||
@@ -974,7 +961,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
|
||||
// melody pattern paint event
|
||||
|
||||
if( m_pat->m_patternType == pattern::MelodyPattern )
|
||||
if( m_pat->m_patternType == Pattern::MelodyPattern )
|
||||
{
|
||||
if( m_pat->m_notes.size() > 0 )
|
||||
{
|
||||
@@ -1064,7 +1051,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
|
||||
// beat pattern paint event
|
||||
|
||||
else if( m_pat->m_patternType == pattern::BeatPattern &&
|
||||
else if( m_pat->m_patternType == Pattern::BeatPattern &&
|
||||
( fixedTCOs() || ppt >= 96
|
||||
|| m_pat->m_steps != MidiTime::stepsPerTact() ) )
|
||||
{
|
||||
@@ -1159,8 +1146,3 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user