summaryrefslogtreecommitdiff
path: root/muse2/muse/waveedit
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-10 17:06:00 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-10 17:06:00 +0000
commit24f84a489364741eb3fc126a3f83d91a86b65e27 (patch)
tree63a4e20aaf4a2ebd2462c91b574eddceeac31170 /muse2/muse/waveedit
parent38c5cccc7273247353264bb7dc97f42296d8e259 (diff)
parent2120ea4f083228dde0d7307203391a4ec8f57e2d (diff)
merged the first bunch of orcans changes
STILL WAIT WITH COMMITTING NEW STUFF! i have to merge the rest as well! this is a bit buggy (connect errors, not tested much), but doesn't segfault immediately
Diffstat (limited to 'muse2/muse/waveedit')
-rw-r--r--muse2/muse/waveedit/CMakeLists.txt11
-rw-r--r--muse2/muse/waveedit/editgain.cpp30
-rw-r--r--muse2/muse/waveedit/editgain.h30
-rw-r--r--muse2/muse/waveedit/waveedit.cpp47
-rw-r--r--muse2/muse/waveedit/waveedit.h24
-rw-r--r--muse2/muse/waveedit/waveview.cpp25
-rw-r--r--muse2/muse/waveedit/waveview.h17
7 files changed, 147 insertions, 37 deletions
diff --git a/muse2/muse/waveedit/CMakeLists.txt b/muse2/muse/waveedit/CMakeLists.txt
index b6646cbb..f32eb6e1 100644
--- a/muse2/muse/waveedit/CMakeLists.txt
+++ b/muse2/muse/waveedit/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# 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.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/waveedit/editgain.cpp b/muse2/muse/waveedit/editgain.cpp
index c36df603..bcb19928 100644
--- a/muse2/muse/waveedit/editgain.cpp
+++ b/muse2/muse/waveedit/editgain.cpp
@@ -1,14 +1,36 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/waveedit/editgain.cpp $
//
-// C++ Implementation: editgain
-//
-// Description:
-//
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
+// 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; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Implementation: editgain
+//
+// Description:
+//
+//
#include <QDialog>
diff --git a/muse2/muse/waveedit/editgain.h b/muse2/muse/waveedit/editgain.h
index 9cbc1d79..5d41c7d4 100644
--- a/muse2/muse/waveedit/editgain.h
+++ b/muse2/muse/waveedit/editgain.h
@@ -1,14 +1,36 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/waveedit/editgain.h $
//
-// C++ Interface: editgain
-//
-// Description:
-//
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
+// 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; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Interface: editgain
+//
+// Description:
+//
+//
#ifndef EDITGAIN_H
#define EDITGAIN_H
diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp
index e138769d..0d42ab6b 100644
--- a/muse2/muse/waveedit/waveedit.cpp
+++ b/muse2/muse/waveedit/waveedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveedit.cpp,v 1.5.2.12 2009/04/06 01:24:54 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QMenu>
@@ -159,15 +174,15 @@ WaveEdit::WaveEdit(PartList* pl)
tools = addToolBar(tr("Wave edit tools"));
tools->setObjectName("Wave edit tools");
- tools->addActions(undoRedo->actions());
+ tools->addActions(MusEGlobal::undoRedo->actions());
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
//--------------------------------------------------
// Transport Bar
QToolBar* transport = addToolBar(tr("transport"));
transport->setObjectName("transport");
- transport->addActions(transportAction->actions());
+ transport->addActions(MusEGlobal::transportAction->actions());
//--------------------------------------------------
// ToolBar: Solo Cursor1 Cursor2
@@ -187,10 +202,10 @@ WaveEdit::WaveEdit(PartList* pl)
tb1->addWidget(label);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
label->setIndent(3);
- pos1 = new PosLabel(0);
+ pos1 = new MusEWidget::PosLabel(0);
pos1->setFixedHeight(22);
tb1->addWidget(pos1);
- pos2 = new PosLabel(0);
+ pos2 = new MusEWidget::PosLabel(0);
pos2->setFixedHeight(22);
pos2->setSmpte(true);
tb1->addWidget(pos2);
@@ -210,7 +225,7 @@ WaveEdit::WaveEdit(PartList* pl)
xscale = -8000;
}
- hscroll = new ScrollScale(1, -32768, xscale, 10000, Qt::Horizontal, mainw, 0, true, 10000.0);
+ hscroll = new MusEWidget::ScrollScale(1, -32768, xscale, 10000, Qt::Horizontal, mainw, 0, true, 10000.0);
view = new WaveView(this, mainw, xscale, yscale);
wview = view; // HACK!
@@ -221,7 +236,7 @@ WaveEdit::WaveEdit(PartList* pl)
ymag->setPageStep(256);
ymag->setValue(yscale);
- time = new MTScale(&_raster, mainw, xscale, true);
+ time = new MusEWidget::MTScale(&_raster, mainw, xscale, true);
ymag->setFixedWidth(16);
connect(view, SIGNAL(mouseWheelMoved(int)), this, SLOT(moveVerticalSlider(int)));
connect(ymag, SIGNAL(valueChanged(int)), view, SLOT(setYScale(int)));
@@ -234,7 +249,7 @@ WaveEdit::WaveEdit(PartList* pl)
mainGrid->setColumnStretch(0, 100);
mainGrid->addWidget(time, 0, 0, 1, 2);
- mainGrid->addWidget(hLine(mainw), 1, 0, 1, 2);
+ mainGrid->addWidget(MusEUtil::hLine(mainw), 1, 0, 1, 2);
mainGrid->addWidget(view, 2, 0);
mainGrid->addWidget(ymag, 2, 1);
mainGrid->addWidget(hscroll, 3, 0);
@@ -287,7 +302,7 @@ void WaveEdit::initShortcuts()
void WaveEdit::configChanged()
{
- view->setBg(config.waveEditBackgroundColor);
+ view->setBg(MusEConfig::config.waveEditBackgroundColor);
selectAllAction->setShortcut(shortcuts[SHRT_SELECT_ALL].key);
selectNoneAction->setShortcut(shortcuts[SHRT_SELECT_NONE].key);
}
@@ -331,7 +346,7 @@ void WaveEdit::setTime(unsigned samplepos)
WaveEdit::~WaveEdit()
{
- // undoRedo->removeFrom(tools); // p4.0.6 Removed
+ // MusEGlobal::undoRedo->removeFrom(tools); // p4.0.6 Removed
}
//---------------------------------------------------------
@@ -355,7 +370,7 @@ void WaveEdit::readConfiguration(Xml& xml)
switch (token) {
case Xml::TagStart:
if (tag == "bgcolor")
- config.waveEditBackgroundColor = readColor(xml);
+ MusEConfig::config.waveEditBackgroundColor = readColor(xml);
else if (tag == "topwin")
TopWin::readConfiguration(WAVE, xml);
else
@@ -380,7 +395,7 @@ void WaveEdit::readConfiguration(Xml& xml)
void WaveEdit::writeConfiguration(int level, Xml& xml)
{
xml.tag(level++, "waveedit");
- xml.colorTag(level, "bgcolor", config.waveEditBackgroundColor);
+ xml.colorTag(level, "bgcolor", MusEConfig::config.waveEditBackgroundColor);
TopWin::writeConfiguration(WAVE, level,xml);
xml.tag(level, "/waveedit");
}
@@ -495,11 +510,11 @@ void WaveEdit::moveVerticalSlider(int val)
void WaveEdit::horizontalZoomIn()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl < 23)
zoomlvl++;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
@@ -508,11 +523,11 @@ void WaveEdit::horizontalZoomIn()
void WaveEdit::horizontalZoomOut()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl > 1)
zoomlvl--;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h
index 4f040d6e..64929555 100644
--- a/muse2/muse/waveedit/waveedit.h
+++ b/muse2/muse/waveedit/waveedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveedit.h,v 1.3.2.8 2008/01/26 07:23:21 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __WAVE_EDIT_H__
@@ -23,11 +38,14 @@ class PartList;
class WaveView;
class ScrollScale;
class QSlider;
-class PosLabel;
class QResizeEvent;
class SNode;
class QAction;
+namespace MusEWidget {
+class PosLabel;
+}
+
//---------------------------------------------------------
// WaveEdit
//---------------------------------------------------------
@@ -40,8 +58,8 @@ class WaveEdit : public MidiEditor {
QToolBar* tools;
QToolBar* tb1;
QToolButton* solo;
- PosLabel* pos1;
- PosLabel* pos2;
+ MusEWidget::PosLabel* pos1;
+ MusEWidget::PosLabel* pos2;
QAction* selectAllAction;
QAction* selectNoneAction;
QAction* cutAction;
diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp
index 236e2588..2b3ddfbf 100644
--- a/muse2/muse/waveedit/waveview.cpp
+++ b/muse2/muse/waveedit/waveview.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveview.cpp,v 1.10.2.16 2009/11/14 03:37:48 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -33,7 +48,7 @@ bool modifyWarnedYet = false;
//---------------------------------------------------------
WaveView::WaveView(MidiEditor* pr, QWidget* parent, int xscale, int yscale)
- : View(parent, xscale, 1)
+ : MusEWidget::View(parent, xscale, 1)
{
editor = pr;
setVirt(true);
@@ -713,7 +728,7 @@ void WaveView::modifySelection(int operation, unsigned startpos, unsigned stoppo
unsigned file_channels = file.channels();
QString tmpWavFile = QString::null;
- if (!getUniqueTmpfileName("tmp_musewav",".wav", tmpWavFile)) {
+ if (!MusEGlobal::getUniqueTmpfileName("tmp_musewav",".wav", tmpWavFile)) {
break;
}
@@ -819,7 +834,7 @@ void WaveView::copySelection(unsigned file_channels, float** tmpdata, unsigned l
if (copiedPart!="") {
QFile::remove(copiedPart);
}
- if (!getUniqueTmpfileName("tmp_musewav",".wav", copiedPart)) {
+ if (!MusEGlobal::getUniqueTmpfileName("tmp_musewav",".wav", copiedPart)) {
return;
}
@@ -936,7 +951,7 @@ void WaveView::editExternal(unsigned file_format, unsigned file_samplerate, unsi
{
// Create yet another tmp-file
QString exttmpFileName;
- if (!getUniqueTmpfileName("tmp_musewav",".wav", exttmpFileName)) {
+ if (!MusEGlobal::getUniqueTmpfileName("tmp_musewav",".wav", exttmpFileName)) {
printf("Could not create temp file - aborting...\n");
return;
}
@@ -954,7 +969,7 @@ void WaveView::editExternal(unsigned file_format, unsigned file_samplerate, unsi
// Forkaborkabork
int pid = fork();
if (pid == 0) {
- if (execlp(config.externalWavEditor.toLatin1().constData(), config.externalWavEditor.toLatin1().constData(), exttmpFileName.toLatin1().constData(), NULL) == -1) {
+ if (execlp(MusEConfig::config.externalWavEditor.toLatin1().constData(), MusEConfig::config.externalWavEditor.toLatin1().constData(), exttmpFileName.toLatin1().constData(), NULL) == -1) {
perror("Failed to launch external editor");
// Get out of here
diff --git a/muse2/muse/waveedit/waveview.h b/muse2/muse/waveedit/waveview.h
index 1a646af9..664fcb51 100644
--- a/muse2/muse/waveedit/waveview.h
+++ b/muse2/muse/waveedit/waveview.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveview.h,v 1.3.2.6 2009/02/02 21:38:01 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef WAVE_VIEW_H
@@ -33,7 +48,7 @@ typedef std::list<WaveEventSelection>::iterator iWaveSelection;
// WaveView
//---------------------------------------------------------
-class WaveView : public View {
+class WaveView : public MusEWidget::View {
Q_OBJECT
MidiEditor* editor;