* song/songEditor: added meterModel and meterDialog (which actually is just a widget) as preparation for time-signature-support - it doesn't actually work yet!
* style.css: improved appearence of menu in general * splitted source-files for meterModel and meterDialog and added "simple"-mode for meterDialog git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1014 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -27,52 +27,16 @@
|
||||
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
#include "lcd_spinbox.h"
|
||||
#include "mv_base.h"
|
||||
|
||||
|
||||
class meterModel : public model
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
meterModel( ::model * _parent, track * _track );
|
||||
~meterModel();
|
||||
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name );
|
||||
void loadSettings( const QDomElement & _this,
|
||||
const QString & _name );
|
||||
|
||||
inline int getNumerator( void )
|
||||
{
|
||||
return( m_numeratorModel.value() );
|
||||
}
|
||||
|
||||
inline int getDenominator( void )
|
||||
{
|
||||
return( m_denominatorModel.value() );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
lcdSpinBoxModel m_numeratorModel;
|
||||
lcdSpinBoxModel m_denominatorModel;
|
||||
|
||||
|
||||
signals:
|
||||
void numeratorChanged( void );
|
||||
void denominatorChanged( void );
|
||||
|
||||
|
||||
friend class meterDialog;
|
||||
|
||||
} ;
|
||||
class lcdSpinBox;
|
||||
|
||||
|
||||
class meterDialog : public QWidget, public modelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
meterDialog( QWidget * _parent );
|
||||
meterDialog( QWidget * _parent, bool _simple = FALSE );
|
||||
virtual ~meterDialog();
|
||||
|
||||
virtual void modelChanged( void );
|
||||
|
||||
68
include/meter_model.h
Normal file
68
include/meter_model.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* meter_model.h - model for meter specification
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/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., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _METER_MODEL_H
|
||||
#define _METER_MODEL_H
|
||||
|
||||
#include "lcd_spinbox.h"
|
||||
|
||||
|
||||
class meterModel : public model
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
meterModel( ::model * _parent, track * _track );
|
||||
~meterModel();
|
||||
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name );
|
||||
void loadSettings( const QDomElement & _this,
|
||||
const QString & _name );
|
||||
|
||||
inline int getNumerator( void )
|
||||
{
|
||||
return( m_numeratorModel.value() );
|
||||
}
|
||||
|
||||
inline int getDenominator( void )
|
||||
{
|
||||
return( m_denominatorModel.value() );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
lcdSpinBoxModel m_numeratorModel;
|
||||
lcdSpinBoxModel m_denominatorModel;
|
||||
|
||||
|
||||
signals:
|
||||
void numeratorChanged( void );
|
||||
void denominatorChanged( void );
|
||||
|
||||
|
||||
friend class meterDialog;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "automatable_slider.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "controller.h"
|
||||
#include "meter_model.h"
|
||||
|
||||
|
||||
class pattern;
|
||||
@@ -138,6 +139,11 @@ public:
|
||||
bpm_t getTempo( void );
|
||||
virtual automationPattern * tempoAutomationPattern( void );
|
||||
|
||||
const meterModel & getTimeSig( void ) const
|
||||
{
|
||||
return( m_timeSigModel );
|
||||
}
|
||||
|
||||
track * getAutomationTrack( void )
|
||||
{
|
||||
return( m_automationTrack );
|
||||
@@ -175,7 +181,7 @@ public:
|
||||
void addController( controller * _c );
|
||||
|
||||
// QT will implicitly share the Vector I believe..
|
||||
controllerVector controllers( void ) const
|
||||
const controllerVector & controllers( void ) const
|
||||
{
|
||||
return m_controllers;
|
||||
}
|
||||
@@ -209,6 +215,7 @@ private slots:
|
||||
void addSampleTrack( void );
|
||||
|
||||
void setTempo( void );
|
||||
void setTimeSignature( void );
|
||||
|
||||
void masterVolumeChanged( void );
|
||||
|
||||
@@ -240,6 +247,7 @@ private:
|
||||
track * m_automationTrack;
|
||||
|
||||
lcdSpinBoxModel m_tempoModel;
|
||||
meterModel m_timeSigModel;
|
||||
sliderModel m_masterVolumeModel;
|
||||
sliderModel m_masterPitchModel;
|
||||
|
||||
@@ -284,6 +292,7 @@ private:
|
||||
|
||||
signals:
|
||||
void tempoChanged( bpm_t _new_bpm );
|
||||
void timeSignatureChanged( int _num, int _den );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -30,14 +30,15 @@
|
||||
#include <QtCore/QBasicTimer>
|
||||
|
||||
#include "track_container_view.h"
|
||||
#include "lcd_spinbox.h"
|
||||
#include "automatable_slider.h"
|
||||
|
||||
|
||||
class QLabel;
|
||||
class QScrollBar;
|
||||
|
||||
class automatableSlider;
|
||||
class comboBox;
|
||||
class lcdSpinBox;
|
||||
class meterDialog;
|
||||
class song;
|
||||
class textFloat;
|
||||
class toolButton;
|
||||
@@ -83,7 +84,6 @@ private:
|
||||
|
||||
virtual bool allowRubberband( void ) const;
|
||||
|
||||
// virtual void modelChanged( void );
|
||||
|
||||
|
||||
song * m_s;
|
||||
@@ -99,6 +99,7 @@ private:
|
||||
toolButton * m_stopButton;
|
||||
lcdSpinBox * m_tempoSpinBox;
|
||||
|
||||
meterDialog * m_timeSigDisplay;
|
||||
automatableSlider * m_masterVolumeSlider;
|
||||
automatableSlider * m_masterPitchSlider;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <QtGui/QPixmap>
|
||||
|
||||
#include "knob.h"
|
||||
#include "meter_dialog.h"
|
||||
#include "meter_model.h"
|
||||
|
||||
|
||||
class QAction;
|
||||
|
||||
Reference in New Issue
Block a user