Made 0.4.12 release
[lmms/mlankhorst.git] / include / surround_area.h
blob16b5822e1881549d1355a3858da3eeb8edaeb48d
1 /*
2 * surround_area.h - class surroundArea which provides widget for setting
3 * position of a channel + calculation of volume for each
4 * speaker
6 * Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
7 *
8 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
20 * You should have received a copy of the GNU General Public
21 * License along with this program (see COPYING); if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301 USA.
28 #ifndef _SURROUND_AREA_H
29 #define _SURROUND_AREA_H
31 #include <QtGui/QWidget>
33 #include "AutomatableModel.h"
34 #include "mixer.h"
37 class QPixmap;
38 class knob;
41 const int SURROUND_AREA_SIZE = 1024;
44 class surroundAreaModel : public Model
46 Q_OBJECT
47 mapPropertyFromModel(int,x,setX,m_posX);
48 mapPropertyFromModel(int,y,setY,m_posY);
49 public:
50 surroundAreaModel( Model * _parent,
51 bool _default_constructed = false );
53 surroundVolumeVector getVolumeVector( float _v_scale ) const;
55 void saveSettings( QDomDocument & _doc, QDomElement & _this,
56 const QString & _name = "surpos" );
57 void loadSettings( const QDomElement & _this,
58 const QString & _name = "surpos" );
60 inline void prepareJournalEntryFromOldVal()
62 m_posX.prepareJournalEntryFromOldVal();
63 m_posY.prepareJournalEntryFromOldVal();
66 inline void addJournalEntryFromOldToCurVal()
68 m_posX.addJournalEntryFromOldToCurVal();
69 m_posY.addJournalEntryFromOldToCurVal();
72 // AutomationPattern * automationPatternX();
73 // AutomationPattern * automationPatternY();
76 private:
77 IntModel m_posX;
78 IntModel m_posY;
80 } ;
84 class surroundArea : public QWidget, public ModelView
86 Q_OBJECT
87 public:
88 surroundArea( QWidget * _parent, const QString & _name );
89 virtual ~surroundArea();
92 surroundAreaModel * model()
94 return( castModel<surroundAreaModel>() );
97 const surroundAreaModel * model() const
99 return( castModel<surroundAreaModel>() );
103 protected:
104 virtual void contextMenuEvent( QContextMenuEvent * _me );
105 virtual void paintEvent( QPaintEvent * _pe );
106 virtual void mousePressEvent( QMouseEvent * _me );
107 virtual void mouseMoveEvent( QMouseEvent * _me );
108 virtual void mouseReleaseEvent( QMouseEvent * _me );
111 private:
112 static QPixmap * s_backgroundArtwork;
117 #endif