renamed time* classes to automation* ones

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@183 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Javier Serrano Polo
2006-06-29 01:01:13 +00:00
parent 7147229b2a
commit fdeef1e0d0
16 changed files with 2757 additions and 54 deletions

258
include/automation_editor.h Normal file
View File

@@ -0,0 +1,258 @@
/*
* automation_editor.h - declaration of class automationEditor which is a window
* where you can edit dynamic values in an easy way
*
* Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _AUTOMATION_EDITOR_H
#define _AUTOMATION_EDITOR_H
#include "qt3support.h"
#ifdef QT4
#include <QtGui/QWidget>
#include <QtCore/QVector>
#include <QtGui/QPixmap>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#include <qpixmap.h>
#endif
#include "types.h"
#include "note.h"
#include "engine.h"
#include "journalling_object.h"
#include "automation_pattern.h"
class QPainter;
class QPixmap;
class QScrollBar;
class comboBox;
class notePlayHandle;
class timeLine;
class toolButton;
class automationEditor : public QWidget, public journallingObject
{
Q_OBJECT
public:
void FASTCALL setCurrentPattern( automationPattern * _new_pattern );
inline const automationPattern * currentPattern( void ) const
{
return( m_pattern );
}
inline bool validPattern( void ) const
{
return( m_pattern != NULL );
}
int quantization( void ) const;
virtual void FASTCALL saveSettings( QDomDocument & _doc,
QDomElement & _parent );
virtual void FASTCALL loadSettings( const QDomElement & _this );
inline virtual QString nodeName( void ) const
{
return( "automation-editor" );
}
public slots:
virtual void update( void );
protected:
typedef automationPattern::timeMap timeMap;
virtual void closeEvent( QCloseEvent * _ce );
virtual void enterEvent( QEvent * _e );
virtual void keyPressEvent( QKeyEvent * _ke );
virtual void leaveEvent( QEvent * _e );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
virtual void wheelEvent( QWheelEvent * _we );
int FASTCALL getValue( int _y );
static inline void drawValueRect( QPainter & _p, Uint16 _x, Uint16 _y,
Sint16 _width, Sint16 _height,
const bool _is_selected );
void removeSelection( void );
void selectAll( void );
void FASTCALL getSelectedValues( timeMap & _selected_values );
protected slots:
void play( void );
void stop( void );
void horScrolled( int _new_pos );
void verScrolled( int _new_pos );
void drawButtonToggled( void );
void eraseButtonToggled( void );
void selectButtonToggled( void );
void moveButtonToggled( void );
void copySelectedValues( void );
void cutSelectedValues( void );
void pasteValues( void );
void deleteSelectedValues( void );
void updatePosition( const midiTime & _t );
void zoomingXChanged( const QString & _zfac );
void zoomingYChanged( const QString & _zfac );
private:
enum editModes
{
DRAW,
ERASE,
SELECT,
MOVE
} ;
enum actions
{
NONE,
MOVE_VALUE,
SELECT_VALUES,
MOVE_SELECTION
} ;
// some constants...
static const int INITIAL_WIDTH = 640;
static const int INITIAL_HEIGHT = 480;
static const int SCROLLBAR_SIZE = 16;
static const int TOP_MARGIN = 48;
static const int DEFAULT_Y_DELTA = 12;
static const int DEFAULT_STEPS_PER_TACT = 16;
static const int DEFAULT_PPT = 12 * DEFAULT_STEPS_PER_TACT;
static const int VALUES_WIDTH = 64;
automationEditor( engine * _engine );
automationEditor( const automationEditor & );
virtual ~automationEditor();
static QPixmap * s_toolDraw;
static QPixmap * s_toolErase;
static QPixmap * s_toolSelect;
static QPixmap * s_toolMove;
QWidget * m_toolBar;
toolButton * m_playButton;
toolButton * m_stopButton;
toolButton * m_drawButton;
toolButton * m_eraseButton;
toolButton * m_selectButton;
toolButton * m_moveButton;
toolButton * m_cutButton;
toolButton * m_copyButton;
toolButton * m_pasteButton;
comboBox * m_zoomingXComboBox;
comboBox * m_zoomingYComboBox;
comboBox * m_quantizeComboBox;
QPixmap m_paintPixmap;
bool m_cursorInside;
automationPattern * m_pattern;
int m_min_level;
int m_max_level;
int m_scroll_level;
int m_bottom_level;
int m_top_level;
void updateTopBottomLevels( void );
QScrollBar * m_leftRightScroll;
QScrollBar * m_topBottomScroll;
midiTime m_currentPosition;
actions m_action;
Uint32 m_selectStartTact64th;
int m_selectedTact64th;
int m_selectStartKey;
int m_selectedKeys;
int m_moveStartKey;
int m_moveStartTact64th;
int m_moveXOffset;
int m_ppt;
int m_y_delta;
timeMap m_valuesToCopy;
timeMap m_selValuesForMove;
editModes m_editMode;
timeLine * m_timeLine;
bool m_scrollBack;
bool xVisible( int _x );
bool inBBEditor( void );
friend class engine;
signals:
void positionChanged( const midiTime & );
} ;
#endif

View File

@@ -0,0 +1,111 @@
/*
* automation_pattern.h - declaration of class automationPattern, which contains
* all information about an automation pattern
*
* Copyright (c) 2006 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _AUTOMATION_PATTERN_H
#define _AUTOMATION_PATTERN_H
#include "qt3support.h"
#include "track.h"
#include "level_object.h"
class automationPattern : public QObject, public journallingObject
{
Q_OBJECT
public:
typedef QMap<midiTime, int> timeMap;
automationPattern( track * _channel_track, levelObject * _object );
automationPattern( const automationPattern & _pat_to_copy );
virtual ~automationPattern();
virtual midiTime length( void ) const;
midiTime FASTCALL putValue( const midiTime & _time, const int _value,
const bool _quant_pos = TRUE );
void FASTCALL removeValue( const midiTime & _time );
void clearValues( void );
inline timeMap & getTimeMap( void )
{
return( m_time_map );
}
int FASTCALL valueAt( const midiTime & _time );
const QString name( void );
// settings-management
virtual void FASTCALL saveSettings( QDomDocument & _doc,
QDomElement & _parent );
virtual void FASTCALL loadSettings( const QDomElement & _this );
static inline const QString classNodeName( void )
{
return( "automation-pattern" );
}
inline virtual QString nodeName( void ) const
{
return( classNodeName() );
}
inline track * getTrack( void )
{
return( m_track );
}
inline levelObject * object( void )
{
return( m_object );
}
void processMidiTime( const midiTime & _time );
protected slots:
void openInAutomationEditor( void );
void clear( void );
private:
track * m_track;
levelObject * m_object;
timeMap m_time_map;
void init( void );
} ;
#endif

View File

@@ -26,6 +26,7 @@
#ifndef _ENGINE_H
#define _ENGINE_H
class automationEditor;
class bbEditor;
class projectJournal;
class mainWindow;
@@ -33,7 +34,6 @@ class mixer;
class pianoRoll;
class projectNotes;
class songEditor;
class timeRoll;
class engine
@@ -98,9 +98,9 @@ public:
return( m_projectJournal );
}
inline timeRoll * getTimeRoll( void )
inline automationEditor * getAutomationEditor( void )
{
return( m_timeRoll );
return( m_automationEditor );
}
@@ -110,11 +110,11 @@ private:
mixer * m_mixer;
mainWindow * m_mainWindow;
songEditor * m_songEditor;
automationEditor * m_automationEditor;
bbEditor * m_bbEditor;
pianoRoll * m_pianoRoll;
projectNotes * m_projectNotes;
projectJournal * m_projectJournal;
timeRoll * m_timeRoll;
} ;

View File

@@ -118,11 +118,11 @@ public slots:
void showSettingsDialog( void );
void aboutLMMS( void );
void help( void );
void toggleAutomationEditorWin( void );
void toggleBBEditorWin( void );
void toggleSongEditorWin( void );
void toggleProjectNotesWin( void );
void togglePianoRollWin( void );
void toggleTimeRollWin( void );
void undo( void );
void redo( void );

View File

@@ -59,7 +59,7 @@ public:
PLAY_TRACK,
PLAY_BB,
PLAY_PATTERN,
PLAY_TIME_PATTERN,
PLAY_AUTOMATION_PATTERN,
PLAY_MODE_CNT
} ;

View File

@@ -62,9 +62,9 @@
class QMenu;
class QPushButton;
class automationPattern;
class pixmapButton;
class textFloat;
class timePattern;
class track;
class trackContainer;
class trackContentWidget;
@@ -485,8 +485,8 @@ public:
return( &m_trackWidget->getTrackContentWidget() );
}
void addTimePattern( timePattern * _pattern );
void removeTimePattern( timePattern * _pattern );
void addAutomationPattern( automationPattern * _pattern );
void removeAutomationPattern( automationPattern * _pattern );
// name-stuff
inline virtual const QString & name( void ) const
@@ -507,7 +507,7 @@ protected:
private:
trackContainer * m_trackContainer;
trackWidget * m_trackWidget;
QPtrList<timePattern> m_time_patterns;
QPtrList<automationPattern> m_automation_patterns;
} ;