Commit 633f2827 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Audio datas are now regenerated.

parent fd44ed6c
......@@ -426,11 +426,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 ) );
Commands::trigger( new Commands::MainWorkflow::AddClip( m_mainWorkflow,
m_dragItem->clip(),
m_dragItem->trackNumber(),
(qint64)mappedXPos,
TrackWorkflow::Audio ) );
m_dragItem = NULL;
}
}
......
......@@ -214,8 +214,8 @@ MainWorkflow::OutputBuffers* MainWorkflow::getSynchroneOutput()
m_effectEngine->render();
m_synchroneRenderWaitConditionMutex->unlock();
m_outputBuffers->video = &( m_effectEngine->getOutputFrame( 0 ) );
// m_outputBuffers->video = reinterpret_cast<LightVideoFrame*>( m_tracks[TrackWorkflow::Video]->getSynchroneOutput() );
// m_outputBuffers->audio = reinterpret_cast<unsigned char*>( m_tracks[TrackWorkflow::Audio]->getSynchroneOutput() );
m_outputBuffers->audio = m_tracks[TrackWorkflow::Audio]->getTmpAudioBuffer();
return m_outputBuffers;
}
......
......@@ -46,7 +46,11 @@ TrackHandler::TrackHandler( unsigned int nbTracks, TrackWorkflow::TrackType trac
TrackHandler::~TrackHandler()
{
delete nullOutput;
if ( nullOutput != NULL )
{
delete nullOutput;
nullOutput = NULL;
}
delete m_nbTracksToRenderMutex;
for (unsigned int i = 0; i < m_trackCount; ++i)
......@@ -98,6 +102,7 @@ void TrackHandler::getOutput( qint64 currentFrame )
{
m_renderCompleted = false;
m_nbTracksToRender = 0;
m_tmpAudioBuffer = NULL;
QMutexLocker lockNbTracks( m_nbTracksToRenderMutex );
for ( unsigned int i = 0; i < m_trackCount; ++i )
{
......@@ -297,7 +302,7 @@ void TrackHandler::tracksRenderCompleted( unsigned int trackId )
}
else
{
qDebug() << "Audio isn't implemented yet !";
m_tmpAudioBuffer = reinterpret_cast<unsigned char*>( m_tracks[trackId]->getSynchroneOutput() );
}
}
//We check for minus or equal, since we can have 0 frame to compute,
......
......@@ -57,6 +57,9 @@ class TrackHandler : public QObject
void clear();
void setFullSpeedRender( bool value );
//FIXME: remove this. This should go by the effect engine.
unsigned char* getTmpAudioBuffer() { return m_tmpAudioBuffer; }
bool isPaused() const;
bool allTracksRendered() const;
......@@ -85,6 +88,7 @@ class TrackHandler : public QObject
*/
bool m_renderCompleted;
EffectsEngine* m_effectEngine;
unsigned char* m_tmpAudioBuffer;
private slots:
......
......@@ -51,8 +51,8 @@ class TrackWorkflow : public QObject
enum TrackType
{
Video,
NbType,
Audio,
NbType
};
TrackWorkflow( unsigned int trackId, TrackType type );
~TrackWorkflow();
......
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