2
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
6
A MIDI and audio sequencer and musical notation editor.
8
This program is Copyright 2000-2008
9
Guillaume Laurent <glaurent@telegraph-road.org>,
10
Chris Cannam <cannam@all-day-breakfast.com>,
11
Richard Bown <richard.bown@ferventsoftware.com>
13
This file is Copyright 2007-2008
14
Yves Guillemot <yc.guillemot@wanadoo.fr>
16
The moral rights of Guillaume Laurent, Chris Cannam, and Richard
17
Bown to claim authorship of this work have been asserted.
19
Other copyrights also apply to some parts of this work. Please
20
see the AUTHORS file and individual file headers for details.
22
This program is free software; you can redistribute it and/or
23
modify it under the terms of the GNU General Public License as
24
published by the Free Software Foundation; either version 2 of the
25
License, or (at your option) any later version. See the file
26
COPYING included with this distribution for more information.
30
#ifndef _RG_HEADERSGROUP_H_
31
#define _RG_HEADERSGROUP_H_
33
#include "base/Track.h"
54
class HeadersGroup : public QVBox
59
* Create an empty headers group
61
HeadersGroup(QWidget *parent, NotationView * nv, Composition * comp);
63
void removeAllHeaders();
65
void addHeader(int trackId, int height, int ypos, double xcur);
68
* Resize a filler at bottom of group to set the headersGroup height
69
* to the value specified in parameter.
70
* (Used to give to the headers group exactly the same height as the
71
* canvas. Necessary to get synchronous vertical scroll.)
73
void completeToHeight(int height);
75
NotationView * getNotationView()
76
{ return m_notationView;
79
Composition * getComposition()
80
{ return m_composition;
84
* Return the total height of all the headers (without the filler).
87
{ return m_usedHeight;
91
* Highlight as "current" the header of the specified track.
93
void setCurrent(TrackId trackId);
96
* Highlight as "current" the header of the specified track.
103
typedef enum { ShowNever, ShowWhenNeeded, ShowAlways } ShowHeadersModeType;
105
// Used to ensure to have one default value and only one.
106
static const ShowHeadersModeType DefaultShowMode = ShowAlways;
108
// Useful in configuration dialog.
109
static bool isValidShowMode(int mode)
111
return ((mode >= ShowNever) && (mode <= ShowAlways));
116
* Called when notation canvas moves.
117
* Setting force to true forces the headers to be redrawn even
118
* if x has not changed since the last call.
120
void slotUpdateAllHeaders(int x, int y, bool force = false);
123
void headersResized(int newWidth);
126
void resizeEvent(QResizeEvent * ev);
128
NotationView * m_notationView;
129
Composition * m_composition;
131
typedef std::vector<TrackHeader *> TrackHeaderVector;
132
TrackHeaderVector m_headers;