Remove unnecessary/unused template parameter from canvas sysex flags.

Add license headers to canvas sysex files (tsk, tsk).


git-svn-id: svn://localhost/ardour2/branches/3.0@4610 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-02-17 02:19:16 +00:00
parent 022818b4a7
commit b857756f60
4 changed files with 59 additions and 36 deletions

View File

@ -1,3 +1,22 @@
/*
Copyright (C) 2009 Paul Davis
Author: Hans Baier
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; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <iostream>
#include "ardour_ui.h"
@ -7,15 +26,13 @@
using namespace Gnome::Canvas;
using namespace std;
template<typename Time>
CanvasSysEx<Time>::CanvasSysEx(
MidiRegionView& region,
Group& parent,
string& text,
double height,
double x,
double y
)
CanvasSysEx::CanvasSysEx(
MidiRegionView& region,
Group& parent,
string& text,
double height,
double x,
double y)
: CanvasFlag(
region,
parent,
@ -23,20 +40,17 @@ CanvasSysEx<Time>::CanvasSysEx(
ARDOUR_UI::config()->canvasvar_MidiSysExOutline.get(),
ARDOUR_UI::config()->canvasvar_MidiSysExFill.get(),
x,
y
)
y)
{
set_text(text);
}
template<typename Time>
CanvasSysEx<Time>::~CanvasSysEx()
CanvasSysEx::~CanvasSysEx()
{
}
template<typename Time>
bool
CanvasSysEx<Time>::on_event(GdkEvent* ev)
CanvasSysEx::on_event(GdkEvent* ev)
{
switch (ev->type) {
case GDK_BUTTON_PRESS:
@ -60,4 +74,3 @@ CanvasSysEx<Time>::on_event(GdkEvent* ev)
return false;
}
template class CanvasSysEx<double>;

View File

@ -1,35 +1,49 @@
/*
Copyright (C) 2009 Paul Davis
Author: Hans Baier
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; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef CANVAS_SYSEX_H_
#define CANVAS_SYSEX_H_
#include "canvas-flag.h"
#include <evoral/MIDIEvent.hpp>
class MidiRegionView;
namespace Gnome {
namespace Canvas {
template<typename Time>
class CanvasSysEx : public CanvasFlag
{
public:
CanvasSysEx(
MidiRegionView& region,
Group& parent,
string& text,
double height,
double x,
double y);
MidiRegionView& region,
Group& parent,
string& text,
double height,
double x,
double y);
virtual ~CanvasSysEx();
virtual bool on_event(GdkEvent* ev);
private:
};
} // namespace Canvas
} // namespace Gnome
#endif /*CANVAS_SYSEX_H_*/
#endif /* CANVAS_SYSEX_H_ */

View File

@ -628,7 +628,7 @@ MidiRegionView::display_program_changes()
void
MidiRegionView::display_sysexes()
{
for(MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) {
for (MidiModel::SysExes::const_iterator i = _model->sysexes().begin(); i != _model->sysexes().end(); ++i) {
ARDOUR::MidiModel::TimeType time = (*i)->time();
assert(time >= 0);
@ -647,12 +647,8 @@ MidiRegionView::display_sysexes()
double height = midi_stream_view()->contents_height();
boost::shared_ptr<CanvasSysEx<ARDOUR::MidiModel::TimeType> > sysex =
boost::shared_ptr<CanvasSysEx<ARDOUR::MidiModel::TimeType> >(
new CanvasSysEx<ARDOUR::MidiModel::TimeType>(*this, *group,
text,
height,
x, 1.0));
boost::shared_ptr<CanvasSysEx> sysex = boost::shared_ptr<CanvasSysEx>(
new CanvasSysEx(*this, *group, text, height, x, 1.0));
// Show unless program change is beyond the region bounds
if (time - _region->start() >= _region->length() || time < _region->start()) {

View File

@ -313,7 +313,7 @@ class MidiRegionView : public RegionView
typedef std::vector<ArdourCanvas::CanvasNoteEvent*> Events;
typedef std::vector< boost::shared_ptr<ArdourCanvas::CanvasProgramChange> > PgmChanges;
typedef std::vector< boost::shared_ptr<ArdourCanvas::CanvasSysEx<ARDOUR::MidiModel::TimeType> > > SysExes;
typedef std::vector< boost::shared_ptr<ArdourCanvas::CanvasSysEx> > SysExes;
boost::shared_ptr<ARDOUR::MidiModel> _model;
Events _events;