Commit 5c803c5a authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

AudioClipWorkflow is almost functionnal

It just lacks sound buffer storage
parent 1f8a07f6
......@@ -428,6 +428,11 @@ void TracksView::dropEvent( QDropEvent* event )
m_dragItem->trackNumber(),
(qint64)mappedXPos,
TrackWorkflow::Video ) );
Commands::trigger( new Commands::MainWorkflow::AddClip( m_mainWorkflow,
m_dragItem->clip(),
m_dragItem->trackNumber(),
(qint64)mappedXPos,
TrackWorkflow::Audio ) );
m_dragItem = NULL;
}
}
......
......@@ -61,14 +61,14 @@ void Media::setVideoUnlockCallback( void* callback )
void Media::setAudioLockCallback( void* callback )
{
char param[64];
sprintf( param, ":sout-smem-video-prerender-callback=%lld", (qint64)(intptr_t)callback );
sprintf( param, ":sout-smem-audio-prerender-callback=%lld", (qint64)(intptr_t)callback );
addOption(param);
}
void Media::setAudioUnlockCallback( void* callback )
{
char param[64];
sprintf( param, ":sout-smem-video-postrender-callback=%lld", (qint64)(intptr_t)callback );
sprintf( param, ":sout-smem-audio-postrender-callback=%lld", (qint64)(intptr_t)callback );
addOption( param );
}
......
......@@ -47,8 +47,7 @@ MainWorkflow::MainWorkflow( int trackCount ) :
m_tracks = new TrackHandler*[2];
for ( unsigned int i = 0; i < TrackWorkflow::NbType; ++i )
{
//FIXME after refactoring
TrackWorkflow::TrackType trackType = (i == 0 ? TrackWorkflow::Video : TrackWorkflow::Video );
TrackWorkflow::TrackType trackType = (i == 0 ? TrackWorkflow::Video : TrackWorkflow::Audio );
m_tracks[i] = new TrackHandler( trackCount, trackType );
connect( m_tracks[i], SIGNAL( tracksPaused() ), this, SLOT( tracksPaused() ) );
connect( m_tracks[i], SIGNAL( allTracksRenderCompleted() ), this, SLOT( tracksRenderCompleted() ) );
......
......@@ -30,7 +30,7 @@ TrackHandler::TrackHandler( unsigned int nbTracks, TrackWorkflow::TrackType trac
m_tracks = new Toggleable<TrackWorkflow*>[nbTracks];
for ( unsigned int i = 0; i < nbTracks; ++i )
{
m_tracks[i].setPtr( new TrackWorkflow( i, TrackWorkflow::Video ) );
m_tracks[i].setPtr( new TrackWorkflow( i, trackType ) );
connect( m_tracks[i], SIGNAL( trackEndReached( unsigned int ) ), this, SLOT( trackEndReached(unsigned int) ) );
connect( m_tracks[i], SIGNAL( trackPaused() ), this, SLOT( trackPaused() ) );
connect( m_tracks[i], SIGNAL( trackUnpaused() ), this, SLOT( trackUnpaused() ) );
......@@ -105,7 +105,6 @@ void TrackHandler::getOutput( qint64 currentFrame )
{
if ( m_tracks[i].activated() == false )
continue ;
++m_nbTracksToRender;
m_tracks[i]->getOutput( currentFrame );
}
......
......@@ -25,6 +25,7 @@
#include "vlmc.h"
#include "TrackWorkflow.h"
#include "VideoClipWorkflow.h"
#include "AudioClipWorkflow.h"
TrackWorkflow::TrackWorkflow( unsigned int trackId, TrackWorkflow::TrackType type ) :
m_trackId( trackId ),
......@@ -55,9 +56,13 @@ TrackWorkflow::~TrackWorkflow()
void TrackWorkflow::addClip( Clip* clip, qint64 start )
{
if ( m_trackType == Audio )
start = 0;
ClipWorkflow* cw;
if ( m_trackType == TrackWorkflow::Video )
cw = new VideoClipWorkflow( clip );
else
cw = new AudioClipWorkflow( clip );
addClip( cw, start );
}
......@@ -121,7 +126,7 @@ void TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
{
cw->getStateLock()->lockForRead();
// qDebug() << "Rendering clip" << cw << "state:" << cw->getState();
// qDebug() << "Rendering clip" << cw << "state:" << cw->getState() << "Type:" << m_trackType;
if ( cw->getState() == ClipWorkflow::Rendering )
{
//The rendering state meens... whell it means that the frame is
......
......@@ -50,7 +50,7 @@ class TrackWorkflow : public QObject
enum TrackType
{
Video,
// Audio,
Audio,
NbType
};
TrackWorkflow( unsigned int trackId, TrackType type );
......
......@@ -65,7 +65,8 @@ SOURCES += src/main.cpp \
src/Project/ProjectManager.cpp \
src/Configuration/SettingsManager.cpp \
src/Workflow/VideoClipWorkflow.cpp \
src/Workflow/TrackHandler.cpp
src/Workflow/TrackHandler.cpp \
src/Workflow/AudioClipWorkflow.cpp
HEADERS += src/GUI/MainWindow.h \
src/GUI/DockWidgetManager.h \
src/GUI/LibraryWidget.h \
......@@ -123,7 +124,8 @@ HEADERS += src/GUI/MainWindow.h \
src/Project/ProjectManager.h \
src/Configuration/SettingsManager.h \
src/Workflow/VideoClipWorkflow.h \
src/Workflow/TrackHandler.h
src/Workflow/TrackHandler.h \
src/Workflow/AudioClipWorkflow.h
FORMS += src/GUI/ui/MainWindow.ui \
src/GUI/ui/PreviewWidget.ui \
src/GUI/ui/LanguagePreferences.ui \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment