|
From: Yoda-JM <yo...@us...> - 2009-08-28 18:58:58
|
Module: performous
Branch: master
Commit: eda1e0dcf3fc4855d963b5c4f41beda11bec1adf
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Aug 28 20:58:28 2009 +0200
Added some editor code
---
editor/ffmpeg.hh | 1 -
editor/main.cc | 9 +++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/editor/ffmpeg.hh b/editor/ffmpeg.hh
index 5b85297..b7eefbc 100644
--- a/editor/ffmpeg.hh
+++ b/editor/ffmpeg.hh
@@ -157,7 +157,6 @@ class AudioBuffer {
bool eof(int64_t pos) const { return double(pos) / m_sps >= m_duration; }
double duration() const { return m_duration; }
void setDuration(double seconds) { m_duration = seconds; }
- double position() { return double(m_pos) / m_sps; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
return oldest > 0 && m_posReq < int64_t(oldest);
diff --git a/editor/main.cc b/editor/main.cc
index 6ab7ae4..75a7ead 100644
--- a/editor/main.cc
+++ b/editor/main.cc
@@ -4,15 +4,16 @@
int main(int argc, char **argv) {
// Load audio
FFmpeg mpeg(false, true, argv[1], 48000);
- int64_t position;
- /*
+ int64_t position = 0;
+
da::sample_t *sample = new da::sample_t(2*4800);
da::pcm_data data(sample, 1500, 2, 48000);
while( mpeg.audioQueue(data, position) ) {
- std::cout << "Position: " << mpeg.audioQueue.position() << std::endl;
+ std::cout << "Position: " << position << std::endl;
+ position += (data.frames * data.channels);
}
+
std::cout << "Total: " << mpeg.audioQueue.duration() << std::endl;
- */
return EXIT_SUCCESS;
}
|