[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src audiofileio/audiofileio.pro comman...
From: |
Remon Sijrier |
Subject: |
[Traverso-commit] traverso/src audiofileio/audiofileio.pro comman... |
Date: |
Mon, 24 Sep 2007 16:58:40 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Remon Sijrier <r_sijrier> 07/09/24 16:58:40
Modified files:
src/audiofileio: audiofileio.pro
src/commands : Fade.cpp Fade.h
src/core : AudioClip.cpp AudioClip.h Curve.cpp Curve.h
FadeCurve.cpp FadeCurve.h
src/engine : defines.h
src/plugins/native: GainEnvelope.cpp GainEnvelope.h
src/plugins : PluginChain.h
src/traverso/dialogs: AudioClipEditDialog.cpp
src/traverso/songcanvas: AudioClipView.cpp AudioClipView.h
CurveNodeView.cpp CurveView.cpp
FadeView.cpp SongView.cpp SongView.h
src : base.pri
Log message:
* Move RELAYTOOL defines too defines.h to cleanup the .pro files, and
get rid of backslashes, quotes double qoutes etc
* Convert Curve and related classes to work with TimeRef
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/audiofileio/audiofileio.pro?cvsroot=traverso&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/Fade.cpp?cvsroot=traverso&r1=1.21&r2=1.22
http://cvs.savannah.gnu.org/viewcvs/traverso/src/commands/Fade.h?cvsroot=traverso&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClip.cpp?cvsroot=traverso&r1=1.135&r2=1.136
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/AudioClip.h?cvsroot=traverso&r1=1.63&r2=1.64
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Curve.cpp?cvsroot=traverso&r1=1.43&r2=1.44
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/Curve.h?cvsroot=traverso&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/FadeCurve.cpp?cvsroot=traverso&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/FadeCurve.h?cvsroot=traverso&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/traverso/src/engine/defines.h?cvsroot=traverso&r1=1.20&r2=1.21
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/native/GainEnvelope.cpp?cvsroot=traverso&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/native/GainEnvelope.h?cvsroot=traverso&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/traverso/src/plugins/PluginChain.h?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/dialogs/AudioClipEditDialog.cpp?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/AudioClipView.cpp?cvsroot=traverso&r1=1.90&r2=1.91
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/AudioClipView.h?cvsroot=traverso&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/CurveNodeView.cpp?cvsroot=traverso&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/CurveView.cpp?cvsroot=traverso&r1=1.57&r2=1.58
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/FadeView.cpp?cvsroot=traverso&r1=1.18&r2=1.19
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/SongView.cpp?cvsroot=traverso&r1=1.77&r2=1.78
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/SongView.h?cvsroot=traverso&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/traverso/src/base.pri?cvsroot=traverso&r1=1.45&r2=1.46
Patches:
Index: audiofileio/audiofileio.pro
===================================================================
RCS file: /sources/traverso/traverso/src/audiofileio/audiofileio.pro,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- audiofileio/audiofileio.pro 23 Sep 2007 02:58:32 -0000 1.12
+++ audiofileio/audiofileio.pro 24 Sep 2007 16:58:37 -0000 1.13
@@ -45,33 +45,6 @@
INCLUDEPATH += ../../3thparty/include .
}
-unix{
- system(which relaytool 2>/dev/null >/dev/null){
- DEFINES += RELAYTOOL_FLAC="'extern int libFLAC_is_present; extern int
libFLAC_symbol_is_present(char *s);'"
-
- DEFINES += RELAYTOOL_MAD="'extern int libmad_is_present; extern int
libmad_symbol_is_present(char *s);'"
-
- DEFINES += RELAYTOOL_VORBISFILE="'extern int libvorbisfile_is_present;
extern int libvorbisfile_symbol_is_present(char *s);'"
- } else{
- DEFINES += RELAYTOOL_FLAC="'static const int libFLAC_is_present=1;
static int __attribute__((unused)) libFLAC_symbol_is_present(char *) { return
1; }'"
-
- DEFINES += RELAYTOOL_MAD="'static const int libmad_is_present=1;
static int __attribute__((unused)) libmad_symbol_is_present(char *) { return 1;
}'"
-
- DEFINES += RELAYTOOL_VORBISFILE="'static const int
libvorbisfile_is_present=1; static int __attribute__((unused))
libvorbisfile_symbol_is_present(char *) { return 1; }'"
-
- DEFINES += RELAYTOOL_MP3LAME="'static const int
libmp3lame_is_present=1; static int __attribute__((unused))
libmp3lame_symbol_is_present(char *) { return 1; }'"
- }
-}
-
-!unix{
- DEFINES += RELAYTOOL_FLAC="\"static const int libFLAC_is_present=1; static
int __attribute__((unused)) libFLAC_symbol_is_present(char *) { return 1; }\""
-
- DEFINES += RELAYTOOL_MAD="\"static const int libmad_is_present=1; static
int __attribute__((unused)) libmad_symbol_is_present(char *) { return 1; }\""
-
- DEFINES += RELAYTOOL_VORBISFILE="\"static const int
libvorbisfile_is_present=1; static int __attribute__((unused))
libvorbisfile_symbol_is_present(char *) { return 1; }\""
-
- DEFINES += RELAYTOOL_MP3LAME="\"static const int libmp3lame_is_present=1;
static int __attribute__((unused)) libmp3lame_symbol_is_present(char *) {
return 1; }\""
-}
HEADERS -= PeakDataReader.h \
decode/PeakDataReader.h
SOURCES -= decode/PeakDataReader.cpp
Index: commands/Fade.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/commands/Fade.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- commands/Fade.cpp 11 Aug 2007 22:54:58 -0000 1.21
+++ commands/Fade.cpp 24 Sep 2007 16:58:37 -0000 1.22
@@ -41,23 +41,26 @@
static const float RASTER_SIZE = 0.05;
-FadeRange::FadeRange(AudioClip* clip, FadeCurve* curve)
+FadeRange::FadeRange(AudioClip* clip, FadeCurve* curve, qint64 scalefactor)
: Command(clip, "")
+ , d(new Private())
{
m_curve = curve;
- m_direction = (m_curve->get_fade_type() == FadeCurve::FadeIn) ? 1 : -1;
- setText( (m_direction == 1) ? tr("Fade In: range") : tr("Fade Out:
range"));
+ d->direction = (m_curve->get_fade_type() == FadeCurve::FadeIn) ? 1 : -1;
+ d->scalefactor = scalefactor;
+ setText( (d->direction == 1) ? tr("Fade In: range") : tr("Fade Out:
range"));
}
-FadeRange::FadeRange(AudioClip* clip, FadeCurve* curve, double newVal)
+FadeRange::FadeRange(AudioClip* clip, FadeCurve* curve, double newRange)
: Command(clip, "")
+ , d(new Private())
{
m_curve = curve;
- m_direction = (m_curve->get_fade_type() == FadeCurve::FadeIn) ? 1 : -1;
- setText( (m_direction == 1) ? tr("Fade In: reset") : tr("Fade Out:
reset"));
- origFade = m_curve->get_range();
- newFade = newVal;
+ d->direction = (m_curve->get_fade_type() == FadeCurve::FadeIn) ? 1 : -1;
+ m_origRange = m_curve->get_range();
+ m_newRange = newRange;
+ setText( (d->direction == 1) ? tr("Fade In: reset") : tr("Fade Out:
reset"));
}
@@ -71,29 +74,30 @@
int FadeRange::begin_hold()
{
- origX = cpointer().on_first_input_event_x();
- newFade = origFade = m_curve->get_range();
+ d->origX = cpointer().on_first_input_event_x();
+ m_newRange = m_origRange = m_curve->get_range();
return 1;
}
int FadeRange::finish_hold()
{
- QCursor::setPos(m_mousePos);
+ QCursor::setPos(d->mousePos);
+ delete d;
return 1;
}
int FadeRange::do_action()
{
- m_curve->set_range( newFade );
+ m_curve->set_range( m_newRange );
return 1;
}
int FadeRange::undo_action()
{
- m_curve->set_range( origFade );
+ m_curve->set_range( m_origRange );
return 1;
}
@@ -109,7 +113,7 @@
Q_UNUSED(useX);
Q_UNUSED(useY);
- m_mousePos = QCursor::pos();
+ d->mousePos = QCursor::pos();
cpointer().get_viewport()->set_holdcursor(":/cursorHoldLr");
}
@@ -117,16 +121,16 @@
int FadeRange::jog()
{
- int dx = (origX - (cpointer().x()) ) * m_direction;
- newFade = origFade - ( dx *
Peak::zoomStep[m_curve->get_song()->get_hzoom() ]);
+ int dx = (d->origX - (cpointer().x()) ) * d->direction;
+ m_newRange = m_origRange - ( dx * d->scalefactor);
- if (newFade < 1) {
- newFade = 1;
+ if (m_newRange < 1) {
+ m_newRange = 1;
}
- m_curve->set_range( newFade );
+ m_curve->set_range( m_newRange );
-
cpointer().get_viewport()->set_holdcursor_text(frame_to_ms_3((nframes_t)newFade,
pm().get_project()->get_rate()));
+
cpointer().get_viewport()->set_holdcursor_text(frame_to_ms_3((nframes_t)m_newRange,
pm().get_project()->get_rate()));
return 1;
}
Index: commands/Fade.h
===================================================================
RCS file: /sources/traverso/traverso/src/commands/Fade.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- commands/Fade.h 28 Jun 2007 06:42:03 -0000 1.11
+++ commands/Fade.h 24 Sep 2007 16:58:37 -0000 1.12
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: Fade.h,v 1.11 2007/06/28 06:42:03 benjie Exp $
+$Id: Fade.h,v 1.12 2007/09/24 16:58:37 r_sijrier Exp $
*/
#ifndef FADE_H
@@ -34,7 +34,7 @@
class FadeRange : public Command
{
public :
- FadeRange(AudioClip* clip, FadeCurve* curve);
+ FadeRange(AudioClip* clip, FadeCurve* curve, qint64 scalefactor);
FadeRange(AudioClip* clip, FadeCurve* curve, double newVal);
~FadeRange();
@@ -50,13 +50,17 @@
void set_cursor_shape(int useX, int useY);
private :
- int origX;
- int m_direction;
- double origFade;
- double newFade;
- QPoint m_mousePos;
-
FadeCurve* m_curve;
+ double m_origRange;
+ double m_newRange;
+ class Private {
+ public:
+ int origX;
+ int direction;
+ QPoint mousePos;
+ qint64 scalefactor;
+ };
+ Private* d;
};
Index: core/AudioClip.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClip.cpp,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -b -r1.135 -r1.136
--- core/AudioClip.cpp 24 Sep 2007 00:57:50 -0000 1.135
+++ core/AudioClip.cpp 24 Sep 2007 16:58:38 -0000 1.136
@@ -149,7 +149,6 @@
m_songId = e.attribute("sheet", "0").toLongLong();
m_isMuted = e.attribute( "mute", "" ).toInt();
- // FIXME!!!!!!!!
bool ok;
m_sourceStartLocation = TimeRef(e.attribute( "sourcestart", ""
).toLongLong(&ok));
m_length = TimeRef(e.attribute( "length", "0" ).toLongLong(&ok));
@@ -357,20 +356,20 @@
emit trackEndLocationChanged();
}
-void AudioClip::set_fade_in(nframes_t b)
+void AudioClip::set_fade_in(double range)
{
if (!fadeIn) {
create_fade_in();
}
- fadeIn->set_range( b );
+ fadeIn->set_range(range);
}
-void AudioClip::set_fade_out(nframes_t b)
+void AudioClip::set_fade_out(double range)
{
if (!fadeOut) {
create_fade_out();
}
- fadeOut->set_range( b );
+ fadeOut->set_range(range);
}
void AudioClip::set_gain(float gain)
@@ -460,18 +459,13 @@
}
- for (int chan=0; chan<bus->get_channel_count(); ++chan) {
for (int i=0; i<m_fades.size(); ++i) {
- m_fades.at(i)->process(mixdown[chan], read_frames);
+ m_fades.at(i)->process(mixdown, read_frames,
bus->get_channel_count());
}
- m_fader->process_gain(mixdown[chan], ((transportLocation -
m_trackStartLocation - m_sourceStartLocation).to_frame(get_rate())),
read_frames);
-
- Mixer::apply_gain_to_buffer(bus->get_buffer(chan, nframes),
nframes, get_gain());
- }
-
-
+ TimeRef startlocation = transportLocation - m_trackStartLocation -
m_sourceStartLocation;
+ m_fader->process_gain(mixdown, startlocation, upperRange, read_frames,
bus->get_channel_count());
return 1;
}
@@ -837,22 +831,6 @@
return m_recordingStatus;
}
-Command * AudioClip::clip_fade_in( )
-{
- if (!fadeIn) {
- create_fade_in();
- }
- return new FadeRange(this, fadeIn);
-}
-
-Command * AudioClip::clip_fade_out( )
-{
- if (!fadeOut) {
- create_fade_out();
- }
- return new FadeRange(this, fadeOut);
-}
-
Command * AudioClip::normalize( )
{
bool ok;
Index: core/AudioClip.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/AudioClip.h,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -b -r1.63 -r1.64
--- core/AudioClip.h 17 Sep 2007 18:14:29 -0000 1.63
+++ core/AudioClip.h 24 Sep 2007 16:58:38 -0000 1.64
@@ -49,8 +49,6 @@
Q_CLASSINFO("reset_fade_in", tr("In: Reset"))
Q_CLASSINFO("reset_fade_out", tr("Out: Reset"))
Q_CLASSINFO("reset_fade_both", tr("Reset both"))
- Q_CLASSINFO("clip_fade_in", tr("In: Range"))
- Q_CLASSINFO("clip_fade_out", tr("Out: Range"))
Q_CLASSINFO("normalize", tr("Normalize"))
Q_CLASSINFO("denormalize", tr("Normalize: reset"))
Q_CLASSINFO("lock", tr("Lock"))
@@ -73,8 +71,8 @@
void set_track_start_location(const TimeRef& location);
void set_name(const QString& name);
- void set_fade_in(nframes_t b);
- void set_fade_out(nframes_t b);
+ void set_fade_in(double range);
+ void set_fade_out(double range);
void set_track(Track* track);
void set_song(Song* song);
@@ -200,8 +198,6 @@
Command* reset_fade_in();
Command* reset_fade_out();
Command* reset_fade_both();
- Command* clip_fade_in();
- Command* clip_fade_out();
Command* normalize();
Command* denormalize();
Command* lock();
Index: core/Curve.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/Curve.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- core/Curve.cpp 10 Sep 2007 18:42:48 -0000 1.43
+++ core/Curve.cpp 24 Sep 2007 16:58:38 -0000 1.44
@@ -181,14 +181,13 @@
return 1;
}
-
-int Curve::process(audio_sample_t* buffer, nframes_t pos, nframes_t nframes)
+int Curve::process(audio_sample_t * buffer, const TimeRef & startlocation,
const TimeRef& endlocation, nframes_t nframes)
{
if (m_nodes.isEmpty()) {
return 0;
}
- if ((pos + nframes) > get_range()) {
+ if (endlocation > qint64(get_range())) {
if (m_nodes.last()->value == 1.0) {
return 0;
}
@@ -198,7 +197,7 @@
audio_sample_t mixdown[nframes];
- get_vector(pos, pos + nframes, mixdown, nframes);
+ get_vector(startlocation.universal_frame(),
endlocation.universal_frame(), mixdown, nframes);
for (nframes_t n = 0; n < nframes; ++n) {
buffer[n] *= mixdown[n];
Index: core/Curve.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/Curve.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- core/Curve.h 30 May 2007 13:57:36 -0000 1.23
+++ core/Curve.h 24 Sep 2007 16:58:38 -0000 1.24
@@ -50,7 +50,7 @@
QDomNode get_state(QDomDocument doc, const QString& name);
virtual int set_state( const QDomNode& node );
- virtual int process(audio_sample_t* buffer, nframes_t pos, nframes_t
nframes);
+ virtual int process(audio_sample_t* buffer, const TimeRef&
startlocation, const TimeRef& endlocation, nframes_t nframes);
Command* add_node(CurveNode* node, bool historable=true);
Command* remove_node(CurveNode* node, bool historable=true);
Index: core/FadeCurve.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/core/FadeCurve.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- core/FadeCurve.cpp 10 Sep 2007 18:42:48 -0000 1.26
+++ core/FadeCurve.cpp 24 Sep 2007 16:58:38 -0000 1.27
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: FadeCurve.cpp,v 1.26 2007/09/10 18:42:48 r_sijrier Exp $
+$Id: FadeCurve.cpp,v 1.27 2007/09/24 16:58:38 r_sijrier Exp $
*/
#include "FadeCurve.h"
@@ -164,7 +164,7 @@
}
-void FadeCurve::process( audio_sample_t * mixdown, nframes_t nframes )
+void FadeCurve::process(audio_sample_t** mixdown, nframes_t nframes, uint
channels)
{
if (is_bypassed() || (get_range() < 16)) {
@@ -172,32 +172,33 @@
}
- int fadepos = 0;
+ TimeRef range = TimeRef(qint64(get_range()));
+ TimeRef fadepos = 0;
if (m_type == FadeIn) {
- if( !( m_song->get_transport_location() <
(m_clip->get_track_start_location() + get_range()) ) ) {
+ if( !( m_song->get_transport_location() <
(m_clip->get_track_start_location() + range) ) ) {
return;
}
- fadepos = (m_song->get_transport_location() -
m_clip->get_track_start_location()).to_frame(audiodevice().get_sample_rate());
+ fadepos = m_song->get_transport_location() -
m_clip->get_track_start_location();
} else {
- if( !(m_song->get_transport_location() >
(m_clip->get_track_end_location() - get_range())) ) {
+ if( !(m_song->get_transport_location() >
(m_clip->get_track_end_location() - range)) ) {
return;
}
- fadepos = (m_song->get_transport_location() -
(m_clip->get_track_end_location() - TimeRef(get_range(),
audiodevice().get_sample_rate()))).to_frame(audiodevice().get_sample_rate());
+ fadepos = m_song->get_transport_location() -
m_clip->get_track_end_location() - range;
}
-// printf("mix_pos is %d, len is %d\n", mix_pos, fadeIn->get_range());
+ TimeRef realframes(nframes, audiodevice().get_sample_rate());
+ TimeRef limit = std::min (realframes.universal_frame(),
range.universal_frame());
- nframes_t limit = std::min (nframes, (uint) get_range());
+ get_vector(fadepos.universal_frame(), (fadepos +
limit).universal_frame(), m_song->gainbuffer,
limit.to_frame(audiodevice().get_sample_rate()));
-
- get_vector(fadepos, fadepos + limit, m_song->gainbuffer, limit);
-
-
- for (nframes_t n = 0; n < limit; ++n) {
- mixdown[n] *= m_song->gainbuffer[n];
+ nframes_t framerange = limit.to_frame(audiodevice().get_sample_rate());
+ for (int chan=0; chan<channels; ++chan) {
+ for (nframes_t frame = 0; frame < framerange; ++frame) {
+ mixdown[chan][frame] *= m_song->gainbuffer[frame];
+ }
}
}
Index: core/FadeCurve.h
===================================================================
RCS file: /sources/traverso/traverso/src/core/FadeCurve.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- core/FadeCurve.h 30 Jun 2007 16:19:10 -0000 1.13
+++ core/FadeCurve.h 24 Sep 2007 16:58:38 -0000 1.14
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: FadeCurve.h,v 1.13 2007/06/30 16:19:10 n_doebelin Exp $
+$Id: FadeCurve.h,v 1.14 2007/09/24 16:58:38 r_sijrier Exp $
*/
#ifndef FADE_CURVE_H
@@ -56,7 +56,7 @@
QDomNode get_state(QDomDocument doc);
int set_state( const QDomNode & node );
- void process(audio_sample_t* mixdown, nframes_t nframes);
+ void process(audio_sample_t** mixdown, nframes_t nframes, uint
channels);
float get_bend_factor() {return m_bendFactor;}
float get_strength_factor() {return m_strenghtFactor;}
Index: engine/defines.h
===================================================================
RCS file: /sources/traverso/traverso/src/engine/defines.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -b -r1.20 -r1.21
--- engine/defines.h 11 Sep 2007 14:16:03 -0000 1.20
+++ engine/defines.h 24 Sep 2007 16:58:38 -0000 1.21
@@ -301,7 +301,60 @@
return time;
}
+#if defined (RELAYTOOL_PRESENT)
-#endif
+#define RELAYTOOL_JACK \
+ extern int libjack_is_present;\
+ extern int libjack_symbol_is_present(char *s);
+
+#define RELAYTOOL_WAVPACK \
+ extern int libwavpack_is_present;\
+ extern int libwavpack_symbol_is_present(char *s);
+
+#define RELAYTOOL_FLAC \
+ extern int libFLAC_is_present;\
+ extern int libFLAC_symbol_is_present(char *s);
+
+
+#define RELAYTOOL_MAD \
+ extern int libmad_is_present;\
+ extern int libmad_symbol_is_present(char *s);
+
+#define RELAYTOOL_VORBISFILE \
+ extern int libvorbisfile_is_present;\
+ extern int libvorbisfile_symbol_is_present(char *s);
+
+
+#else
+
+
+#define RELAYTOOL_JACK \
+ static const int libjack_is_present=1;\
+ static int __attribute__((unused)) libjack_symbol_is_present(char *) {
return 1; }
+
+#define RELAYTOOL_WAVPACK \
+ static const int libwavpack_is_present=1;\
+ static int __attribute__((unused)) libwavpack_symbol_is_present(char *)
{ return 1; }
+
+#define RELAYTOOL_FLAC \
+ static const int libFLAC_is_present=1;\
+ static int __attribute__((unused)) libFLAC_symbol_is_present(char *) {
return 1; }
+
+#define RELAYTOOL_MAD \
+ static const int libmad_is_present=1;\
+ static int __attribute__((unused)) libmad_symbol_is_present(char *) {
return 1; }
+
+#define RELAYTOOL_VORBISFILE \
+ static const int libvorbisfile_is_present=1;\
+ static int __attribute__((unused)) libvorbisfile_symbol_is_present(char
*) { return 1; }
+
+#define RELAYTOOL_MP3LAME \
+ static const int libmp3lame_is_present=1;\
+ static int __attribute__((unused)) libmp3lame_symbol_is_present(char *)
{ return 1; }
+
+#endif // endif RELAYTOOL_PRESENT
+
+
+#endif // endif TRAVERSO_TYPES_H
//eof
Index: plugins/native/GainEnvelope.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/native/GainEnvelope.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- plugins/native/GainEnvelope.cpp 30 May 2007 13:57:37 -0000 1.2
+++ plugins/native/GainEnvelope.cpp 24 Sep 2007 16:58:38 -0000 1.3
@@ -73,14 +73,16 @@
return 1;
}
-void GainEnvelope::process_gain(audio_sample_t* buffer, nframes_t pos,
nframes_t nframes)
+void GainEnvelope::process_gain(audio_sample_t** buffer, const TimeRef&
startlocation, const TimeRef& endlocation, nframes_t nframes, uint channels)
{
PluginControlPort* port = m_controlPorts.at(0);
- Mixer::apply_gain_to_buffer(buffer, nframes, port->get_control_value());
+ for (int chan=0; chan<channels; ++chan) {
+ Mixer::apply_gain_to_buffer(buffer[chan], nframes,
port->get_control_value());
if (port->use_automation()) {
- port->get_curve()->process(buffer, pos, nframes);
+ port->get_curve()->process(buffer[chan], startlocation,
endlocation, nframes);
+ }
}
}
Index: plugins/native/GainEnvelope.h
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/native/GainEnvelope.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- plugins/native/GainEnvelope.h 30 May 2007 13:14:47 -0000 1.1
+++ plugins/native/GainEnvelope.h 24 Sep 2007 16:58:38 -0000 1.2
@@ -39,7 +39,7 @@
QDomNode get_state(QDomDocument doc);
int set_state(const QDomNode & node );
void process(AudioBus* bus, unsigned long nframes);
- void process_gain(audio_sample_t* buffer, nframes_t pos, nframes_t
nframes);
+ void process_gain(audio_sample_t** buffer, const TimeRef&
startlocation, const TimeRef& endlocation, nframes_t nframes, uint channels);
void set_song(Song* song);
void set_gain(float gain) {m_gain = gain;}
Index: plugins/PluginChain.h
===================================================================
RCS file: /sources/traverso/traverso/src/plugins/PluginChain.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- plugins/PluginChain.h 4 Jun 2007 20:47:16 -0000 1.10
+++ plugins/PluginChain.h 24 Sep 2007 16:58:39 -0000 1.11
@@ -48,7 +48,7 @@
Command* remove_plugin(Plugin* plugin, bool historable=true);
void process_pre_fader(AudioBus* bus, unsigned long nframes);
int process_post_fader(AudioBus* bus, unsigned long nframes);
- void process_fader(audio_sample_t* buffer, nframes_t pos, nframes_t
nframes) {m_fader->process_gain(buffer, pos, nframes);}
+// void process_fader(audio_sample_t* buffer, nframes_t pos, nframes_t
nframes) {m_fader->process_gain(buffer, pos, nframes);}
void set_song(Song* song);
Index: traverso/dialogs/AudioClipEditDialog.cpp
===================================================================
RCS file:
/sources/traverso/traverso/src/traverso/dialogs/AudioClipEditDialog.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- traverso/dialogs/AudioClipEditDialog.cpp 11 Sep 2007 14:16:03 -0000
1.10
+++ traverso/dialogs/AudioClipEditDialog.cpp 24 Sep 2007 16:58:39 -0000
1.11
@@ -250,11 +250,11 @@
if (ie().is_holding()) return;
locked = true;
- nframes_t frames =
qtime_to_timeref(time).to_frame(audiodevice().get_sample_rate());
- if (frames == 0) {
+ double range = double(qtime_to_timeref(time).universal_frame());
+ if (range == 0) {
m_clip->set_fade_in(1);
} else {
- m_clip->set_fade_in(frames);
+ m_clip->set_fade_in(range);
}
locked = false;
}
Index: traverso/songcanvas/AudioClipView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/AudioClipView.cpp,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -b -r1.90 -r1.91
--- traverso/songcanvas/AudioClipView.cpp 20 Sep 2007 18:24:10 -0000
1.90
+++ traverso/songcanvas/AudioClipView.cpp 24 Sep 2007 16:58:39 -0000
1.91
@@ -41,7 +41,7 @@
#include <QFileDialog>
#include "AudioClipEditDialog.h"
-
+#include "Fade.h"
#include "AudioDevice.h"
// Always put me below _all_ includes, this is needed
@@ -774,14 +774,31 @@
int x = (int) (cpointer().on_first_input_event_scene_x() -
scenePos().x());
if (x < (m_boundingRect.width() / 2)) {
- return m_clip->clip_fade_in();
+ return clip_fade_in();
} else {
- return m_clip->clip_fade_out();
+ return clip_fade_out();
}
return 0;
}
+Command * AudioClipView::clip_fade_in( )
+{
+ if (! m_clip->get_fade_in()) {
+ // This implicitely creates the fadecurve
+ m_clip->set_fade_in(1);
+ }
+ return new FadeRange(m_clip, m_clip->get_fade_in(),
m_sv->timeref_scalefactor);
+}
+
+Command * AudioClipView::clip_fade_out( )
+{
+ if (! m_clip->get_fade_out()) {
+ m_clip->set_fade_out(1);
+ }
+ return new FadeRange(m_clip, m_clip->get_fade_out(),
m_sv->timeref_scalefactor);
+}
+
Command * AudioClipView::reset_fade()
{
Q_ASSERT(m_song);
Index: traverso/songcanvas/AudioClipView.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/AudioClipView.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- traverso/songcanvas/AudioClipView.h 17 Sep 2007 18:14:30 -0000 1.30
+++ traverso/songcanvas/AudioClipView.h 24 Sep 2007 16:58:39 -0000 1.31
@@ -41,6 +41,8 @@
{
Q_OBJECT
Q_CLASSINFO("fade_range", tr("In/Out: Range"))
+ Q_CLASSINFO("clip_fade_in", tr("In: Range"))
+ Q_CLASSINFO("clip_fade_out", tr("Out: Range"))
Q_CLASSINFO("select_fade_in_shape", tr("In: Select shape"));
Q_CLASSINFO("select_fade_out_shape", tr("Out: Select shape"));
Q_CLASSINFO("reset_fade", tr("In/Out: Reset"));
@@ -132,6 +134,8 @@
void position_changed();
Command* fade_range();
+ Command* clip_fade_in();
+ Command* clip_fade_out();
Command* select_fade_in_shape();
Command* select_fade_out_shape();
Command* reset_fade();
Index: traverso/songcanvas/CurveNodeView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/CurveNodeView.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- traverso/songcanvas/CurveNodeView.cpp 27 Jun 2007 21:12:23 -0000
1.10
+++ traverso/songcanvas/CurveNodeView.cpp 24 Sep 2007 16:58:39 -0000
1.11
@@ -107,10 +107,13 @@
void CurveNodeView::update_pos( )
{
- setPos( ((m_node->get_when() - m_curveview->get_start_offset()) /
m_sv->scalefactor) - (m_boundingRect.width() / 2),
- m_parentViewItem->boundingRect().height() -
(m_node->get_value() * m_parentViewItem->boundingRect().height() +
m_boundingRect.height() / 2 ));
+ qreal halfwidth = (m_boundingRect.width() / 2);
+ qreal parentheight = m_parentViewItem->boundingRect().height();
+ qreal when = ((qint64(m_node->get_when()) -
m_curveview->get_start_offset()) / m_sv->timeref_scalefactor) - halfwidth;
+ qreal value = parentheight - (m_node->get_value() * parentheight +
halfwidth);
+ setPos(when, value);
- set_when_and_value((m_node->get_when() / m_sv->scalefactor),
m_node->get_value());
+ set_when_and_value((m_node->get_when() / m_sv->timeref_scalefactor),
m_node->get_value());
}
void CurveNodeView::set_selected( )
Index: traverso/songcanvas/CurveView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/CurveView.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -b -r1.57 -r1.58
--- traverso/songcanvas/CurveView.cpp 10 Sep 2007 18:44:16 -0000 1.57
+++ traverso/songcanvas/CurveView.cpp 24 Sep 2007 16:58:39 -0000 1.58
@@ -58,14 +58,22 @@
int jog();
private :
- CurveView* m_curveView;
+ class Private {
+ public:
+ CurveView* curveView;
+ int scalefactor;
+ long rangeMin;
+ long rangeMax;
+ QPoint mousepos;
+ };
+
+ Private* d;
CurveNode* m_node;
- int m_scalefactor;
- QPointF m_origPos;
- QPointF m_newPos;
- long m_rangeMin;
- long m_rangeMax;
- QPoint m_mousepos;
+ double m_origWhen;
+ double m_origValue;
+ double m_newWhen;
+ double m_newValue;
+
public slots:
void move_up(bool autorepeat);
@@ -78,12 +86,13 @@
DragNode::DragNode(CurveNode* node, CurveView* curveview, int scalefactor,
long rangeMin, long rangeMax, const QString& des)
: Command(curveview->get_context(), des)
+ , d(new Private)
{
m_node = node;
- m_rangeMin = rangeMin;
- m_rangeMax = rangeMax;
- m_curveView = curveview;
- m_scalefactor = scalefactor;
+ d->rangeMin = rangeMin;
+ d->rangeMax = rangeMax;
+ d->curveView = curveview;
+ d->scalefactor = scalefactor;
}
int DragNode::prepare_actions()
@@ -93,46 +102,47 @@
int DragNode::finish_hold()
{
+ delete d;
return 1;
}
void DragNode::cancel_action()
{
+ delete d;
undo_action();
}
int DragNode::begin_hold()
{
- m_origPos.setX(m_node->get_when());
- m_origPos.setY(m_node->get_value());
- m_newPos = m_origPos;
+ m_origWhen = m_newWhen = m_node->get_when();
+ m_origValue = m_newValue = m_node->get_value();
- m_mousepos = QPoint(cpointer().on_first_input_event_x(),
cpointer().on_first_input_event_y());
+ d->mousepos = QPoint(cpointer().on_first_input_event_x(),
cpointer().on_first_input_event_y());
return 1;
}
int DragNode::do_action()
{
- m_node->set_when_and_value(m_newPos.x(), m_newPos.y());
+ m_node->set_when_and_value(m_newWhen, m_newValue);
return 1;
}
int DragNode::undo_action()
{
- m_node->set_when_and_value(m_origPos.x(), m_origPos.y());
+ m_node->set_when_and_value(m_origWhen, m_origValue);
return 1;
}
void DragNode::move_up(bool )
{
- m_newPos.setY(m_newPos.y() + ( 1 /
m_curveView->boundingRect().height()) );
+ m_newValue = m_newValue + ( 1 / d->curveView->boundingRect().height());
do_action();
}
void DragNode::move_down(bool )
{
- m_newPos.setY(m_newPos.y() - ( 1 /
m_curveView->boundingRect().height()) );
+ m_newValue = m_newValue - ( 1 / d->curveView->boundingRect().height());
do_action();
}
@@ -141,36 +151,37 @@
QPoint mousepos = cpointer().pos();
int dx, dy;
- dx = mousepos.x() - m_mousepos.x();
- dy = mousepos.y() - m_mousepos.y();
+ dx = mousepos.x() - d->mousepos.x();
+ dy = mousepos.y() - d->mousepos.y();
- m_mousepos = mousepos;
+ d->mousepos = mousepos;
- m_newPos.setX(m_newPos.x() + dx * m_scalefactor);
- m_newPos.setY(m_newPos.y() - ( dy /
m_curveView->boundingRect().height()) );
+ m_newWhen = m_newWhen + dx * d->scalefactor;
+ m_newValue = m_newValue - ( dy / d->curveView->boundingRect().height());
+ printf("m_newWhen is %f, %d\n", m_newWhen, dx);
- TimeRef startoffset = m_curveView->get_start_offset();
- if ( ((int)(m_newPos.x() -
startoffset.to_frame(audiodevice().get_sample_rate()))/ m_scalefactor) >
m_curveView->boundingRect().width()) {
- m_newPos.setX(m_curveView->boundingRect().width() *
m_scalefactor + startoffset.to_frame(audiodevice().get_sample_rate()));
+ TimeRef startoffset = d->curveView->get_start_offset();
+ if ( ((qint64(m_newWhen) - startoffset) / d->scalefactor) >
d->curveView->boundingRect().width()) {
+ m_newWhen = double(d->curveView->boundingRect().width() *
d->scalefactor + startoffset.universal_frame());
}
- if ( m_newPos.x() -
startoffset.to_frame(audiodevice().get_sample_rate()) < 0) {
-
m_newPos.setX(startoffset.to_frame(audiodevice().get_sample_rate()));
+ if ((qint64(m_newWhen) - startoffset) < 0) {
+ m_newWhen = startoffset.universal_frame();
}
- if (m_newPos.y() < 0.0) {
- m_newPos.setY(0.0);
+ if (m_newValue < 0.0) {
+ m_newValue = 0.0;
}
- if (m_newPos.x() < 0.0) {
- m_newPos.setX(0.0);
+ if (m_newValue > 1.0) {
+ m_newValue = 1.0;
}
- if (m_newPos.y() > 1.0) {
- m_newPos.setY(1.0);
+ if (m_newWhen < 0.0) {
+ m_newWhen = 0.0;
}
- if (m_newPos.x() < m_rangeMin) {
- m_newPos.setX(m_rangeMin);
- } else if (m_rangeMax != -1 && m_newPos.x() > m_rangeMax) {
- m_newPos.setX(m_rangeMax);
+ if (m_newWhen < d->rangeMin) {
+ m_newWhen = d->rangeMin;
+ } else if (d->rangeMax != -1 && m_newWhen > d->rangeMax) {
+ m_newWhen = d->rangeMax;
}
return do_action();
@@ -257,7 +268,7 @@
float vector[pixelcount];
// printf("range: %d\n", (int)m_nodeViews.last()->pos().x());
- int offset = m_startoffset / m_sv->timeref_scalefactor;
+ int offset = int(m_startoffset / m_sv->timeref_scalefactor);
m_guicurve->get_vector(xstart + offset,
xstart + pixelcount + offset,
vector,
@@ -468,8 +479,11 @@
emit curveModified();
- CurveNode* node = new CurveNode(m_curve, point.x() * m_sv->scalefactor
+ m_startoffset.to_frame(audiodevice().get_sample_rate()),
- (m_boundingRect.height() - point.y())
/ m_boundingRect.height());
+ double when = point.x() * double(m_sv->timeref_scalefactor) +
m_startoffset.universal_frame();
+ double value = (m_boundingRect.height() - point.y()) /
m_boundingRect.height();
+
+ CurveNode* node = new CurveNode(m_curve, when, value);
+
return m_curve->add_node(node);
}
@@ -501,8 +515,8 @@
update_softselected_node(QPoint((int)origPos.x(), (int)origPos.y()),
true);
if (m_blinkingNode) {
- long min = 0;
- long max = -1;
+ qint64 min = 0;
+ qint64 max = -1;
QList<CurveNode* >* nodeList = m_curve->get_nodes();
CurveNode* node = m_blinkingNode->get_curve_node();
int index = nodeList->indexOf(node);
@@ -510,12 +524,12 @@
emit curveModified();
if (index > 0) {
- min = (long)(nodeList->at(index-1)->get_when() + 1);
+ min = qint64(nodeList->at(index-1)->get_when() + 1);
}
if (nodeList->size() > index + 1) {
- max = (long)(nodeList->at(index+1)->get_when() - 1);
+ max = qint64(nodeList->at(index+1)->get_when() - 1);
}
- return new DragNode(m_blinkingNode->get_curve_node(), this,
m_sv->scalefactor, min, max, tr("Drag Node"));
+ return new DragNode(m_blinkingNode->get_curve_node(), this,
m_sv->timeref_scalefactor, min, max, tr("Drag Node"));
}
return ie().did_not_implement();
}
Index: traverso/songcanvas/FadeView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/FadeView.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- traverso/songcanvas/FadeView.cpp 26 Jun 2007 23:43:21 -0000 1.18
+++ traverso/songcanvas/FadeView.cpp 24 Sep 2007 16:58:39 -0000 1.19
@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-$Id: FadeView.cpp,v 1.18 2007/06/26 23:43:21 benjie Exp $
+$Id: FadeView.cpp,v 1.19 2007/09/24 16:58:39 r_sijrier Exp $
*/
#include "FadeView.h"
@@ -53,7 +53,7 @@
foreach(CurveNode* node, *m_fadeCurve->get_nodes()) {
CurveNode* guinode = new CurveNode(m_guicurve,
- node->get_when() / m_sv->scalefactor,
+ node->get_when() / m_sv->timeref_scalefactor,
node->get_value());
AddRemove* cmd = (AddRemove*) m_guicurve->add_node(guinode,
false);
cmd->set_instantanious(true);
@@ -222,7 +222,7 @@
for (int i=0; i<guinodes->size(); ++i) {
CurveNode* node = nodes->at(i);
CurveNode* guinode = guinodes->at(i);
- guinode->set_when_and_value(node->get_when() /
m_sv->scalefactor, node->get_value());
+ guinode->set_when_and_value(node->get_when() /
m_sv->timeref_scalefactor, node->get_value());
}
double range = m_guicurve->get_range();
Index: traverso/songcanvas/SongView.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/SongView.cpp,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -b -r1.77 -r1.78
--- traverso/songcanvas/SongView.cpp 10 Sep 2007 19:22:52 -0000 1.77
+++ traverso/songcanvas/SongView.cpp 24 Sep 2007 16:58:39 -0000 1.78
@@ -104,8 +104,7 @@
m_tpvp->setSceneRect(-200, 0, 0, MAX_CANVAS_HEIGHT);
- scalefactor = Peak::zoomStep[m_song->get_hzoom()];
- timeref_scalefactor = scalefactor * 640;
+ timeref_scalefactor = Peak::zoomStep[m_song->get_hzoom()] * 640;
song_mode_changed();
@@ -164,8 +163,7 @@
void SongView::scale_factor_changed( )
{
- scalefactor = Peak::zoomStep[m_song->get_hzoom()];
- timeref_scalefactor = scalefactor * 640;
+ timeref_scalefactor = Peak::zoomStep[m_song->get_hzoom()] * 640;
m_tlvp->scale_factor_changed();
layout_tracks();
}
Index: traverso/songcanvas/SongView.h
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/SongView.h,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- traverso/songcanvas/SongView.h 29 Aug 2007 18:00:36 -0000 1.36
+++ traverso/songcanvas/SongView.h 24 Sep 2007 16:58:40 -0000 1.37
@@ -88,7 +88,6 @@
int hscrollbar_value() const;
int vscrollbar_value() const;
- int scalefactor;
qint64 timeref_scalefactor;
private:
Index: base.pri
===================================================================
RCS file: /sources/traverso/traverso/src/base.pri,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- base.pri 31 Aug 2007 09:19:51 -0000 1.45
+++ base.pri 24 Sep 2007 16:58:40 -0000 1.46
@@ -116,16 +116,7 @@
GCCVERSION = $$system(gcc -dumpversion)
system(which relaytool 2>/dev/null >/dev/null) {
- DEFINES += RELAYTOOL_JACK="'extern int libjack_is_present;
extern int libjack_symbol_is_present(char *s);'"
-
- DEFINES += RELAYTOOL_WAVPACK="'extern int
libwavpack_is_present; extern int libwavpack_symbol_is_present(char *s);'"
- } else {
- DEFINES += RELAYTOOL_JACK="'static const int
libjack_is_present=1; static int __attribute__((unused))
libjack_symbol_is_present(char *) { return 1; }'"
-
- # put WAVPACK def here so that we can check if it exists
globally
- # so that traverso/ExportWidget.cpp knows if it should offer
- # WAVPACK as an export option
- DEFINES += RELAYTOOL_WAVPACK="'static const int
libwavpack_is_present=1; static int __attribute__((unused))
libwavpack_symbol_is_present(char *) { return 1; }'"
+ DEFINES += RELAYTOOL_PRESENT
}
contains(DEFINES, PRECOMPILED_HEADER):CONFIG += precompile_header
@@ -143,10 +134,6 @@
}
-!unix {
- # other systems have no relaytool
- DEFINES += RELAYTOOL_WAVPACK='"static const int
libwavpack_is_present=1; static int __attribute__((unused))
libwavpack_symbol_is_present(char *) { return 1; }"'
-}
macx {
DEFINES += OSX_BUILD
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src audiofileio/audiofileio.pro comman...,
Remon Sijrier <=