* added MediaConverter, the improved version by Jun Suzuki, to the source tree

* I completely rearranged the source and fixed a few bugs, one of which
  prevented me to use this tool to convert some XViD encoded AVIs that had
  sound to PJPEG encoding.
* it is currently agreed to have this in the source, but not on the image yet,
  the MediaKit doesn't support writing anyways as of now


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21489 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2007-06-21 22:19:02 +00:00
parent b69827d9b5
commit 6af4da5dcb
21 changed files with 2821 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ SubInclude HAIKU_TOP src apps launchbox ;
SubInclude HAIKU_TOP src apps magnify ;
SubInclude HAIKU_TOP src apps mail ;
SubInclude HAIKU_TOP src apps mandelbrot ;
SubInclude HAIKU_TOP src apps mediaconverter ;
SubInclude HAIKU_TOP src apps mediaplayer ;
SubInclude HAIKU_TOP src apps midiplayer ;
SubInclude HAIKU_TOP src apps networkstatus ;
+15
View File
@@ -0,0 +1,15 @@
SubDir HAIKU_TOP src apps mediaconverter ;
SetSubDirSupportedPlatformsBeOSCompatible ;
Application MediaConverter :
MediaConverterApp.cpp
MediaConverterWindow.cpp
MediaEncoderWindow.cpp
MediaFileInfoView.cpp
MediaFileListView.cpp
StatusView.cpp
: be media tracker
: MediaConverter.rdef
;
+31
View File
@@ -0,0 +1,31 @@
----------------------
Be Sample Code License
----------------------
Copyright 1991-1999, Be Incorporated.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions, and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions, and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,77 @@
resource app_signature "application/x-vnd.Haiku-MediaConverter";
resource app_version {
major = 1,
middle = 3,
minor = 1,
variety = B_APPV_BETA,
internal = 0,
short_info = "MediaConverter",
long_info = "MediaConverter ©1999, Be, Inc., ©2000-2004 Jun Suzuki, ©2007 Haiku, Inc."
};
resource app_flags B_SINGLE_LAUNCH;
resource file_types message {
"types" = "application/ogg",
"types" = "application/x-ogg",
"types" = "audio",
"types" = "video"
};
resource large_icon {
$"FFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFFFF00003F3F3F3F3F3F0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFF003F3F3F000000003F3F3F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFF003F3F3F0000000000003F3F3F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FF003F3F3F3F0000000000003F3F3F3F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FF003F3F3F3F3F000000003F3F3F3F3F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"003F3F00003F3F3F00003F3F3F00003F3F00FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"003F000000003F3F3F3F3F3F000000003F00FFFF010101010101FFFFFFFFFFFF"
$"003F00000000003F00003F00000000003F00FFFF01FAFAFAFAFA01FFFFFFFFFF"
$"003F00000000003F00003F00000000003F00FFFF01FAFAFAFAFAFA01FFFFFFFF"
$"003F000000003F3F3F3F3F3F000000003F00FFFF0101010101FAFAFA01FFFFFF"
$"003F3F00003F3F3F00003F3F3F00003F3F00FFFFFFFFFFFFFF01FAFA01FFFFFF"
$"FF003F3F3F3F3F000000003F3F3F3F3F00FFFFFFFFFFFFFFFF01FAFA01FFFFFF"
$"FF003F3F3F3F0000000000003F3F3F3F00FFFFFFFFFF01010101FAFA01010101"
$"FFFF003F3F3F0000000000003F3F3F00FFFFFFFFFFFF01FAFAFAFAFAFAFAFA01"
$"FFFFFF003F3F3F000000003F3F3F00FFFFFFFFFFFFFFFF01FAFAFAFAFAFA01FF"
$"FFFFFFFF00003F3F3F3F3F3F0000FFFFFFFFFFFFFFFFFFFF01FAFAFAFA01FFFF"
$"FFFFFFFFFFFF000000000000FFFFFFFFFFFFFFFFFFFFFFFFFF01FAFA01FFFFFF"
$"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0101FFFFFFFF"
$"FFFFFFFF0101FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
$"FFFFFF01FAFA01FFFFFFFFFFFF00000000000000000000000000000000000000"
$"FFFF01FAFAFAFA01FFFFFFFFFF00003F003F003F003F003F003F003F003F0000"
$"FF01FAFAFAFAFAFA01FFFFFFFF00000000000000000000000000000000000000"
$"01FAFAFAFAFAFAFAFA01FFFFFF00000000000000000000000000000000000000"
$"01010101FAFA01010101FFFFFF0000003F3F3F3F003F3F3F003F3F3F3F000000"
$"FFFFFF01FAFA01FFFFFFFFFFFF00003F3F3F3F3F3F003F003F3F3F3F3F3F0000"
$"FFFFFF01FAFA01FFFFFFFFFFFF00003F3F00003F3F003F003F3F00003F3F0000"
$"FFFFFF01FAFAFA0101010101FF00003F3F00003F3F003F003F3F00003F3F0000"
$"FFFFFFFF01FAFAFAFAFAFA01FF00003F3F3F3F3F3F003F003F3F3F3F3F3F0000"
$"FFFFFFFFFF01FAFAFAFAFA01FF0000003F3F3F3F003F3F3F003F3F3F3F000000"
$"FFFFFFFFFFFF010101010101FF00000000000000000000000000000000000000"
$"FFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000000000"
};
resource mini_icon {
$"FFFFFFFFFFFF00000000FFFFFFFFFFFF"
$"FFFFFFFF00003F3F3F3F0000FFFFFFFF"
$"FFFFFF003F3F3F00003F3F3F00FFFFFF"
$"FFFF003F3F0000000000003F3F00FFFF"
$"FF003F3F3F3F000000003F3F3F3F00FF"
$"FF003F003F3F3F00003F3F3F003F00FF"
$"003F3F00003F3F3F3F3F3F00003F3F00"
$"003F000000003F00003F000000003F00"
$"003F000000003F00003F000000003F00"
$"003F3F00003F3F3F3F3F3F00003F3F00"
$"FF003F003F3F3F00003F3F3F003F00FF"
$"FF003F3F3F3F000000003F3F3F3F00FF"
$"FFFF003F3F0000000000003F3F00FFFF"
$"FFFFFF003F3F3F00003F3F3F00FFFFFF"
$"FFFFFFFF00003F3F3F3F0000FFFFFFFF"
$"FFFFFFFFFFFF00000000FFFFFFFFFFFF"
};
@@ -0,0 +1,599 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#include "MediaConverterApp.h"
#include <inttypes.h>
#include <new>
#include <stdio.h>
#include <string.h>
#include <Alert.h>
#include <MediaFile.h>
#include <MediaTrack.h>
#include <Mime.h>
#include <Path.h>
#include <String.h>
#include <View.h>
#include "MediaConverterWindow.h"
#include "MediaEncoderWindow.h"
#include "MessageConstants.h"
#include "Strings.h"
using std::nothrow;
const char APP_SIGNATURE[] = "application/x-vnd.Haiku-MediaConverter";
MediaConverterApp::MediaConverterApp()
: BApplication(APP_SIGNATURE)
, fWin(NULL)
, fConvertThreadID(-1)
, fConverting(false)
, fCancel(false)
{
// TODO: implement settings for window pos
fWin = new MediaConverterWindow(BRect(50, 50, 520, 555));
}
MediaConverterApp::~MediaConverterApp()
{
if (fConvertThreadID >= 0) {
fCancel = true;
status_t exitValue;
wait_for_thread(fConvertThreadID, &exitValue);
}
}
// #pragma mark -
void
MediaConverterApp::MessageReceived(BMessage *msg)
{
switch (msg->what) {
case FILE_LIST_CHANGE_MESSAGE:
if (fWin->Lock()) {
bool enable = fWin->CountSourceFiles() > 0;
fWin->SetEnabled(enable, enable);
fWin->Unlock();
}
break;
case START_CONVERSION_MESSAGE:
if (!fConverting)
StartConverting();
break;
case CANCEL_CONVERSION_MESSAGE:
fCancel = true;
break;
case CONVERSION_DONE_MESSAGE:
fCancel = false;
fConverting = false;
DetachCurrentMessage();
BMessenger(fWin).SendMessage(msg);
break;
default:
BApplication::MessageReceived(msg);
}
}
void
MediaConverterApp::ReadyToRun()
{
fWin->Show();
fWin->PostMessage(INIT_FORMAT_MENUS);
}
void
MediaConverterApp::RefsReceived(BMessage *msg)
{
entry_ref ref;
int32 i = 0;
BMediaFile *f;
BString errorFiles;
int32 errors = 0;
// from Open dialog or drag & drop
while (msg->FindRef("refs", i++, &ref) == B_OK) {
f = new BMediaFile(&ref/*, B_MEDIA_FILE_NO_READ_AHEAD*/);
if (f->InitCheck() != B_OK) {
errorFiles << ref.name << "\n";
errors++;
delete f;
continue;
}
if (fWin->Lock()) {
fWin->AddSourceFile(f, ref);
fWin->Unlock();
}
}
if (errors) {
BString alertText;
alertText << errors << ((errors > 1) ? FILES : FILE)
<< NOTRECOGNIZE << "\n";
alertText << errorFiles;
BAlert *alert = new BAlert(ERROR_LOAD_STRING, alertText.String(),
CONTINUE_STRING , NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->Go();
}
}
// #pragma mark -
bool
MediaConverterApp::IsConverting() const
{
return fConverting;
}
void
MediaConverterApp::StartConverting()
{
bool locked = fWin->Lock();
if (locked && (fWin->CountSourceFiles() > 0)) {
fConvertThreadID = spawn_thread(MediaConverterApp::_RunConvertEntry,
"converter thread", B_LOW_PRIORITY, (void *)this);
if (fConvertThreadID >= 0) {
fConverting = true;
fCancel = false;
resume_thread(fConvertThreadID);
}
}
if (locked) {
fWin->Unlock();
}
}
void
MediaConverterApp::SetStatusMessage(const char *message)
{
if (fWin != NULL && fWin->Lock()) {
fWin->SetStatusMessage(message);
fWin->Unlock();
}
}
// #pragma mark -
BEntry
MediaConverterApp::_CreateOutputFile(BDirectory directory,
entry_ref* ref, media_file_format* outputFormat)
{
BString name(ref->name);
// create output file name
int32 extIndex = name.FindLast('.');
if (extIndex != B_ERROR)
name.Truncate(extIndex + 1);
else
name.Append(".");
name.Append(outputFormat->file_extension);
BEntry inEntry(ref);
BEntry outEntry;
if (inEntry.InitCheck() == B_OK) {
// ensure that output name is unique
int32 len = name.Length();
int32 i = 1;
while (directory.Contains(name.String())) {
name.Truncate(len);
name << " " << i;
i++;
}
outEntry.SetTo(&directory, name.String());
}
return outEntry;
}
int32
MediaConverterApp::_RunConvertEntry(void* castToMediaConverterApp)
{
MediaConverterApp* app = (MediaConverterApp*)castToMediaConverterApp;
app->_RunConvert();
return 0;
}
void
MediaConverterApp::_RunConvert()
{
bigtime_t start = 0;
bigtime_t end = 0;
int32 audioQuality = 75;
int32 videoQuality = 75;
if (fWin->Lock()) {
char *a;
start = strtoimax(fWin->StartDuration(), &a, 0) * 1000;
end = strtoimax(fWin->EndDuration(), &a, 0) * 1000;
audioQuality = fWin->AudioQuality();
videoQuality = fWin->VideoQuality();
fWin->Unlock();
}
int32 srcIndex = 0;
BMediaFile *inFile(NULL), *outFile(NULL);
BEntry outEntry;
entry_ref inRef;
entry_ref outRef;
BPath path;
BString name;
while (!fCancel) {
if (fWin->Lock()) {
status_t r = fWin->GetSourceFileAt(srcIndex, &inFile, &inRef);
if (r == B_OK) {
media_codec_info* audioCodec;
media_codec_info* videoCodec;
media_file_format* fileFormat;
fWin->GetSelectedFormatInfo(&fileFormat, &audioCodec, &videoCodec);
BDirectory directory = fWin->OutputDirectory();
fWin->Unlock();
outEntry = _CreateOutputFile(directory, &inRef, fileFormat);
// display file name
outEntry.GetPath(&path);
name.SetTo(path.Leaf());
if (outEntry.InitCheck() == B_OK) {
entry_ref outRef;
outEntry.GetRef(&outRef);
outFile = new BMediaFile(&outRef, fileFormat);
name.Prepend(" '");
name.Prepend(OUTPUT_FILE_STRING1);
name.Append("' ");
name.Append(OUTPUT_FILE_STRING2);
} else {
name.Prepend(" '");
name.Prepend(OUTPUT_FILE_STRING3);
name.Append("'");
}
if (fWin->Lock()) {
fWin->SetFileMessage(name.String());
fWin->Unlock();
}
if (outFile != NULL) {
r = _ConvertFile(inFile, outFile, audioCodec, videoCodec,
audioQuality, videoQuality, start, end);
// set mime
update_mime_info(path.Path(), false, false, false);
fWin->Lock();
if (r == B_OK) {
fWin->RemoveSourceFile(srcIndex);
} else {
srcIndex++;
BString error(CONVERT_ERROR_STRING);
error << " '" << inRef.name << "'";
fWin->SetStatusMessage(error.String());
}
fWin->Unlock();
}
} else {
fWin->Unlock();
break;
}
} else {
break;
}
}
BMessenger(this).SendMessage(CONVERSION_DONE_MESSAGE);
}
// #pragma mark -
status_t
MediaConverterApp::_ConvertFile(BMediaFile* inFile, BMediaFile* outFile,
media_codec_info* audioCodec, media_codec_info* videoCodec,
int32 audioQuality, int32 videoQuality,
bigtime_t startDuration, bigtime_t endDuration)
{
BMediaTrack* inVidTrack = NULL;
BMediaTrack* inAudTrack = NULL;
BMediaTrack* outVidTrack = NULL;
BMediaTrack* outAudTrack = NULL;
media_format inFormat;
media_format outAudFormat;
media_format outVidFormat;
media_raw_audio_format* raf = NULL;
media_raw_video_format* rvf = NULL;
int32 width = -1;
int32 height = -1;
short audioFrameSize = 1;
uint8* videoBuffer = NULL;
uint8* audioBuffer = NULL;
// gather the necessary format information and construct output tracks
int64 videoFrameCount = 0;
int64 audioFrameCount = 0;
status_t ret = B_OK;
int32 tracks = inFile->CountTracks();
for (int32 i = 0; i < tracks && (!outAudTrack || !outVidTrack); i++) {
BMediaTrack* inTrack = inFile->TrackAt(i);
memset(&inFormat, 0, sizeof(media_format));
inTrack->EncodedFormat(&inFormat);
if (inFormat.IsAudio() && (audioCodec != NULL)) {
inAudTrack = inTrack;
memset(&outAudFormat, 0, sizeof(media_format));
outAudFormat.type = B_MEDIA_RAW_AUDIO;
raf = &(outAudFormat.u.raw_audio);
inTrack->DecodedFormat(&outAudFormat);
audioBuffer = new uint8[raf->buffer_size];
// audioFrameSize = (raf->format & media_raw_audio_format::B_AUDIO_SIZE_MASK)
audioFrameSize = (raf->format & 0xf) * raf->channel_count;
outAudTrack = outFile->CreateTrack(&outAudFormat, audioCodec);
if (outAudTrack != NULL) {
if (outAudTrack->SetQuality(audioQuality / 100.0f) != B_OK
&& fWin->Lock()) {
fWin->SetAudioQualityLabel(AUDIO_SUPPORT_STRING);
fWin->Unlock();
}
}
} else if (inFormat.IsVideo() && (videoCodec != NULL)) {
inVidTrack = inTrack;
width = (int32)inFormat.Width();
height = (int32)inFormat.Height();
// construct desired decoded video format
// memset(&outVidFormat, 0, sizeof(outVidFormat));
outVidFormat.type = B_MEDIA_RAW_VIDEO;
rvf = &(outVidFormat.u.raw_video);
rvf->last_active = (uint32)(height - 1);
rvf->orientation = B_VIDEO_TOP_LEFT_RIGHT;
rvf->pixel_width_aspect = 1;
rvf->pixel_height_aspect = 1;
rvf->display.format = B_RGB32;
rvf->display.bytes_per_row = 4 * width;
rvf->display.line_width = width;
rvf->display.line_count = height;
inVidTrack->DecodedFormat(&outVidFormat);
if (rvf->display.format == B_RGBA32) {
printf("fixing color space (B_RGBA32 -> B_RGB32)");
rvf->display.format = B_RGB32;
}
videoBuffer = new (nothrow) uint8[height * rvf->display.bytes_per_row];
outVidTrack = outFile->CreateTrack(&outVidFormat, videoCodec);
if (outVidTrack != NULL) {
// DLM Added to use 3ivx Parameter View
const char* videoQualitySupport = NULL;
BView* encoderView = outVidTrack->GetParameterView();
if (encoderView) {
MediaEncoderWindow* encoderWin
= new MediaEncoderWindow(BRect(50, 50, 520, 555), encoderView);
encoderWin->Go();
// blocks until the window is quit
// The quality setting is ignored by the 3ivx encoder if the
// view was displayed, but this method is the trigger to read
// all the parameter settings
outVidTrack->SetQuality(videoQuality / 100.0f);
// We can now delete the encoderView created for us by the encoder
delete encoderView;
encoderView = NULL;
videoQualitySupport = VIDEO_PARAMFORM_STRING;
} else {
if (outVidTrack->SetQuality(videoQuality / 100.0f) >= B_OK)
videoQualitySupport = VIDEO_SUPPORT_STRING;
}
if (videoQualitySupport && fWin->Lock()) {
fWin->SetVideoQualityLabel(videoQualitySupport);
fWin->Unlock();
}
}
} else {
// didn't do anything with the track
inFile->ReleaseTrack(inTrack);
}
}
if (!outVidTrack && !outAudTrack) {
printf("MediaConverterApp::_ConvertFile() - no tracks found!\n");
ret = B_ERROR;
}
if (fCancel) {
// don't have any video or audio tracks here, or cancelled
printf("MediaConverterApp::_ConvertFile() - user canceld before transcoding\n");
ret = B_CANCELED;
}
if (ret < B_OK) {
delete[] audioBuffer;
delete[] videoBuffer;
delete outFile;
return ret;
}
outFile->CommitHeader();
// this is where you would call outFile->AddCopyright(...)
int64 framesRead;
media_header mh;
int32 lastPercent, currPercent;
float completePercent;
BString status;
int64 start;
int64 end;
int32 stat = 0;
// read video from source and write to destination, if necessary
if (outVidTrack != NULL) {
lastPercent = -1;
videoFrameCount = inVidTrack->CountFrames();
if (endDuration == 0 || endDuration < startDuration) {
start = 0;
end = videoFrameCount;
} else {
inVidTrack->SeekToTime(&endDuration, stat);
end = inVidTrack->CurrentFrame();
inVidTrack->SeekToTime(&startDuration, stat);
start = inVidTrack->CurrentFrame();
if (end > videoFrameCount)
end = videoFrameCount;
if (start > end)
start = 0;
}
framesRead = 0;
for (int64 i = start; (i <= end) && !fCancel; i += framesRead) {
if ((ret = inVidTrack->ReadFrames(videoBuffer, &framesRead,
&mh)) != B_OK) {
fprintf(stderr, "Error reading video frame %Ld: %s\n", i,
strerror(ret));
status.SetTo(ERROR_READ_VIDEO_STRING);
status << i;
SetStatusMessage(status.String());
break;
}
//printf("writing frame %lld\n", i);
if ((ret = outVidTrack->WriteFrames(videoBuffer, framesRead,
mh.u.encoded_video.field_flags)) != B_OK) {
fprintf(stderr, "Error writing video frame %Ld: %s\n", i,
strerror(ret));
status.SetTo(ERROR_WRITE_VIDEO_STRING);
status << i;
SetStatusMessage(status.String());
break;
}
completePercent = (float)(i - start) / (float)(end - start) * 100;
currPercent = (int16)floor(completePercent);
if (currPercent > lastPercent) {
lastPercent = currPercent;
status.SetTo(WRITE_VIDEO_STRING);
status.Append(" ");
status << currPercent << "% " << COMPLETE_STRING;
SetStatusMessage(status.String());
}
}
outVidTrack->Flush();
inFile->ReleaseTrack(inVidTrack);
}
// read audio from source and write to destination, if necessary
if (outAudTrack != NULL) {
lastPercent = -1;
audioFrameCount = inAudTrack->CountFrames();
if (endDuration == 0 || endDuration < startDuration) {
start = 0;
end = audioFrameCount;
} else {
inAudTrack->SeekToTime(&endDuration, stat);
end = inAudTrack->CurrentFrame();
inAudTrack->SeekToTime(&startDuration, stat);
start = inAudTrack->CurrentFrame();
if (end > audioFrameCount)
end = audioFrameCount;
if (start > end)
start = 0;
}
for (int64 i = start; (i <= end) && !fCancel; i += framesRead) {
if ((ret = inAudTrack->ReadFrames(audioBuffer, &framesRead,
&mh)) != B_OK) {
fprintf(stderr, "Error reading audio frames: %s\n", strerror(ret));
status.SetTo(ERROR_READ_AUDIO_STRING);
status << i;
SetStatusMessage(status.String());
break;
}
//printf("writing audio frames %lld\n", i);
if ((ret = outAudTrack->WriteFrames(audioBuffer,
framesRead)) != B_OK) {
fprintf(stderr, "Error writing audio frames: %s\n",
strerror(ret));
status.SetTo(ERROR_WRITE_AUDIO_STRING);
status << i;
SetStatusMessage(status.String());
break;
}
completePercent = (float)(i - start) / (float)(end - start) * 100;
currPercent = (int16)floor(completePercent);
if (currPercent > lastPercent) {
lastPercent = currPercent;
status.SetTo(WRITE_AUDIO_STRING);
status.Append(" ");
status << currPercent << "% " << COMPLETE_STRING;
SetStatusMessage(status.String());
}
}
outAudTrack->Flush();
inFile->ReleaseTrack(inAudTrack);
}
outFile->CloseFile();
delete outFile;
delete[] videoBuffer;
delete[] audioBuffer;
return ret;
}
// #pragma mark -
int
main(int, char **)
{
MediaConverterApp app;
app.Run();
return 0;
}
@@ -0,0 +1,56 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef MEDIA_CONVERTER_APP_H
#define MEDIA_CONVERTER_APP_H
#include <Application.h>
#include <Directory.h>
#include <Entry.h>
#include <MediaDefs.h>
#include <MediaFormats.h>
class BMediaFile;
class MediaConverterWindow;
class MediaConverterApp : public BApplication {
public:
MediaConverterApp();
virtual ~MediaConverterApp();
protected:
virtual void MessageReceived(BMessage* message);
virtual void ReadyToRun();
virtual void RefsReceived(BMessage* message);
public:
bool IsConverting() const;
void StartConverting();
void SetStatusMessage(const char* message);
private:
BEntry _CreateOutputFile(BDirectory directory,
entry_ref* ref,
media_file_format* outputFormat);
static int32 _RunConvertEntry(void* castToMediaConverterApp);
void _RunConvert();
status_t _ConvertFile(BMediaFile* inFile,
BMediaFile* outFile,
media_codec_info* audioCodec,
media_codec_info* videoCodec,
int32 audioQuality, int32 videoQuality,
bigtime_t StartTime, bigtime_t EndTime);
MediaConverterWindow* fWin;
thread_id fConvertThreadID;
bool fConverting;
volatile bool fCancel;
};
#endif // MEDIA_CONVERTER_APP_H
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,121 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef MEDIA_CONVERTER_WINDOW_H
#define MEDIA_CONVERTER_WINDOW_H
#include <Directory.h>
#include <MediaDefs.h>
#include <MediaFormats.h>
#include <Window.h>
class BBox;
class BButton;
class BFilePanel;
class BMenuField;
class BSlider;
class BStringView;
class BTextControl;
class MediaFileInfoView;
class MediaFileListView;
class StatusView;
class MediaConverterWindow : public BWindow {
public:
MediaConverterWindow(BRect frame);
virtual ~MediaConverterWindow();
protected:
// virtual void DispatchMessage(BMessage* message,
// BHandler* handler);
virtual void MessageReceived(BMessage* message);
virtual bool QuitRequested();
public:
void LanguageChanged();
void BuildFormatMenu();
void BuildAudioVideoMenus();
void GetSelectedFormatInfo(
media_file_format** _format,
media_codec_info** _audio,
media_codec_info** _video);
void SetStatusMessage(const char *message);
void SetFileMessage(const char *message);
void AddSourceFile(BMediaFile* file,
const entry_ref& ref);
void RemoveSourceFile(int32 index);
int32 CountSourceFiles();
status_t GetSourceFileAt(int32 index, BMediaFile** _file,
entry_ref* ref);
void SourceFileSelectionChanged();
void SetEnabled(bool enabled, bool convertEnabled);
bool IsEnabled();
const char* StartDuration() const;
const char* EndDuration() const;
int32 AudioQuality() const
{ return fAudioQuality; }
int32 VideoQuality() const
{ return fVideoQuality; }
void SetAudioQualityLabel(const char* label);
void SetVideoQualityLabel(const char* label);
BDirectory OutputDirectory() const;
private:
void _UpdateLabels();
void _CreateMenu();
void _DestroyMenu();
void _SetOutputFolder(BEntry entry);
media_format fDummyFormat;
BButton* fConvertButton;
BButton* fDestButton;
BButton* fPreviewButton;
BBox* fBox1;
BBox* fBox2;
BBox* fBox3;
BMenuBar* fMenuBar;
BMenuField* fFormatMenu;
BMenuField* fVideoMenu;
BMenuField* fAudioMenu;
StatusView* fStatusView;
StatusView* fStatusView2;
MediaFileListView* fListView;
MediaFileInfoView* fInfoView;
BStringView* fOutputFolder;
BTextControl* fStartDurationTC;
BTextControl* fEndDurationTC;
BSlider* fVideoQualitySlider;
BSlider* fAudioQualitySlider;
int32 fVideoQuality;
int32 fAudioQuality;
BFilePanel* fSaveFilePanel;
BFilePanel* fOpenFilePanel;
BDirectory fOutputDir;
bool fOutputDirSpecified;
bool fEnabled;
bool fConverting;
bool fCancelling;
};
#endif // MEDIA_CONVERTER_WINDOW_H
@@ -0,0 +1,58 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#include "MediaEncoderWindow.h"
#include <stdio.h>
#include <View.h>
#include "Strings.h"
MediaEncoderWindow::MediaEncoderWindow(BRect frame, BView* view)
: BWindow(frame, ENCODER_PARAMETERS, B_DOCUMENT_WINDOW_LOOK,
B_MODAL_APP_WINDOW_FEEL,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
// create and acquire the quit semaphore
fQuitSem = create_sem(0, "encoder_view");
fView = view;
AddChild(fView);
ResizeTo(fView->Bounds().Width(), fView->Bounds().Height());
}
MediaEncoderWindow::~MediaEncoderWindow()
{
// The view must continue to exist until conversion complete.
RemoveChild(fView);
delete_sem(fQuitSem);
}
void
MediaEncoderWindow::MessageReceived(BMessage *msg)
{
}
bool
MediaEncoderWindow::QuitRequested()
{
return true;
}
void
MediaEncoderWindow::Go()
{
this->Show();
// wait until window is quit
while (acquire_sem(fQuitSem) == B_INTERRUPTED)
;
}
@@ -0,0 +1,29 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef MEDIA_ENCODER_WINDOW_H
#define MEDIA_ENCODER_WINDOW_H
#include <Window.h>
class MediaEncoderWindow : public BWindow {
public:
MediaEncoderWindow(BRect frame,
BView* pBView);
virtual ~MediaEncoderWindow();
void Go();
protected:
virtual void MessageReceived(BMessage *msg);
virtual bool QuitRequested();
private:
BView* fView;
sem_id fQuitSem;
};
#endif // MEDIA_ENCODER_WINDOW_H
@@ -0,0 +1,195 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#include "MediaFileInfoView.h"
#include <string.h>
#include <MediaFile.h>
#include <MediaTrack.h>
#include <String.h>
#include "Strings.h"
MediaFileInfoView::MediaFileInfoView(BRect frame, uint32 resizingMode)
: BView(frame, "MediaFileInfoView", resizingMode,
B_FULL_UPDATE_ON_RESIZE | B_WILL_DRAW)
, fRef()
, fMediaFile(NULL)
, fDuration(0)
{
}
MediaFileInfoView::~MediaFileInfoView()
{
}
void
MediaFileInfoView::Draw(BRect /*update*/)
{
font_height fh;
GetFontHeight(&fh);
BPoint p(2, fh.ascent + fh.leading);
BFont font;
GetFont(&font);
font.SetFace(B_BOLD_FACE);
font.SetSize(12);
SetFont(&font);
if (fMediaFile == NULL) {
DrawString(NO_FILE_LABEL, p);
return;
}
BString aFmt, vFmt, aDetails, vDetails, duration;
_GetFileInfo(&aFmt, &vFmt, &aDetails, &vDetails, &duration);
// draw filename
DrawString(fRef.name, p);
float lineHeight = fh.ascent + fh.descent + fh.leading;
p.y += (float)ceil(lineHeight * 1.5);
float durLen = StringWidth(DURATION_LABEL) + 5;
float audLen = StringWidth(AUDIO_INFO_LABEL) + 5;
float vidLen = StringWidth(VIDEO_INFO_LABEL) + 5;
float maxLen = MAX(durLen, audLen);
maxLen = MAX(maxLen, vidLen);
// draw labels
DrawString(AUDIO_INFO_LABEL, p + BPoint(maxLen - audLen, 0));
BPoint p2 = p;
p2.x += maxLen + 4;
p.y += lineHeight * 2;
DrawString(VIDEO_INFO_LABEL, p + BPoint(maxLen - vidLen, 0));
p.y += lineHeight * 2;
DrawString(DURATION_LABEL, p + BPoint(maxLen - durLen, 0));
// draw audio/video/duration info
font.SetFace(B_REGULAR_FACE);
font.SetSize(10);
SetFont(&font);
DrawString(aFmt.String(), p2);
p2.y += lineHeight;
DrawString(aDetails.String(), p2);
p2.y += lineHeight;
DrawString(vFmt.String(), p2);
p2.y += lineHeight;
DrawString(vDetails.String(), p2);
p2.y += lineHeight;
DrawString(duration.String(), p2);
}
void
MediaFileInfoView::AttachedToWindow()
{
rgb_color c = Parent()->LowColor();
SetViewColor(c);
SetLowColor(c);
}
void
MediaFileInfoView::Update(BMediaFile* file, entry_ref* ref)
{
if (fMediaFile == file)
return;
fMediaFile = file;
if (file != NULL && ref != NULL)
fRef = *ref;
else
fRef = entry_ref();
Invalidate();
}
// #pragma mark -
void
MediaFileInfoView::_GetFileInfo(BString* audioFormat, BString* videoFormat,
BString* audioDetails, BString* videoDetails, BString* duration)
{
fDuration = 0;
if (fMediaFile == NULL)
return;
BMediaTrack* track;
media_format format;
memset(&format, 0, sizeof(format));
media_codec_info codecInfo;
bool audioDone(false), videoDone(false);
bigtime_t audioDuration = 0;
bigtime_t videoDuration = 0;
int32 tracks = fMediaFile->CountTracks();
int64 videoFrames = 0;
int64 audioFrames = 0;
for (int32 i = 0; i < tracks && (!audioDone || !videoDone); i++) {
track = fMediaFile->TrackAt(i);
if (track != NULL) {
track->EncodedFormat(&format);
if (format.IsVideo()) {
memset(&format, 0, sizeof(format));
format.type = B_MEDIA_RAW_VIDEO;
track->DecodedFormat(&format);
media_raw_video_format *rvf = &(format.u.raw_video);
track->GetCodecInfo(&codecInfo);
*videoFormat << codecInfo.pretty_name;
videoDuration = track->Duration();
videoFrames = track->CountFrames();
*videoDetails << (int32)format.Width() << "x" << (int32)format.Height()
<< " " << (int32)(rvf->field_rate / rvf->interlace)
<< " fps / " << videoFrames << " frames";
videoDone = true;
} else if (format.IsAudio()) {
memset(&format, 0, sizeof(format));
format.type = B_MEDIA_RAW_AUDIO;
track->DecodedFormat(&format);
media_raw_audio_format *raf = &(format.u.raw_audio);
char bytesPerSample = (char)(raf->format & 0xf);
if (bytesPerSample == 1) {
*audioDetails << "8 bit ";
} else if (bytesPerSample == 2) {
*audioDetails << "16 bit ";
} else {
*audioDetails << bytesPerSample << "byte ";
}
track->GetCodecInfo(&codecInfo);
*audioFormat << codecInfo.pretty_name;
audioDuration = track->Duration();
audioFrames = track->CountFrames();
*audioDetails << (float)(raf->frame_rate / 1000.0f) << " kHz";
if (raf->channel_count == 1) {
*audioDetails << " mono / ";
} else if (raf->channel_count == 2) {
*audioDetails << " stereo / ";
} else {
*audioDetails << (int32)raf->channel_count << " channel / " ;
}
*audioDetails << audioFrames << " frames";
audioDone = true;
}
fMediaFile->ReleaseTrack(track);
}
}
fDuration = MAX(audioDuration, videoDuration);
*duration << (int32)(fDuration / 1000000)
<< " seconds";
}
@@ -0,0 +1,43 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef MEDIA_FILE_INFO_VIEW_H
#define MEDIA_FILE_INFO_VIEW_H
#include <Entry.h>
#include <View.h>
class BMediaFile;
class BString;
class MediaFileInfoView : public BView {
public:
MediaFileInfoView(BRect frame,
uint32 resizingMode);
virtual ~MediaFileInfoView();
protected:
virtual void Draw(BRect updateRect);
virtual void AttachedToWindow();
public:
void Update(BMediaFile* file, entry_ref* ref);
bigtime_t Duration() const
{ return fDuration; }
private:
void _GetFileInfo(BString* audioFormat,
BString* videoFormat,
BString* audioDetails,
BString* videoDetails,
BString* duration);
entry_ref fRef;
BMediaFile* fMediaFile;
bigtime_t fDuration;
};
#endif // MEDIA_FILE_INFO_VIEW_H
@@ -0,0 +1,109 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#include "MediaFileListView.h"
#include <Application.h>
#include <MediaFile.h>
#include <Messenger.h>
#include "MediaConverterWindow.h"
#include "MessageConstants.h"
// #pragma mark - MediaFileListItem
MediaFileListItem::MediaFileListItem(BMediaFile* file, const entry_ref& ref)
: BStringItem(ref.name),
fRef(ref),
fMediaFile(file)
{
}
MediaFileListItem::~MediaFileListItem()
{
delete fMediaFile;
}
// #pragma mark - MediaFileListView
MediaFileListView::MediaFileListView(BRect frame, uint32 resizingMode)
: BListView(frame, "MediaFileListView", B_SINGLE_SELECTION_LIST, resizingMode,
B_WILL_DRAW | B_NAVIGABLE | B_FRAME_EVENTS)
{
fEnabled = true;
}
MediaFileListView::~MediaFileListView()
{
BListItem *item;
while ((item = RemoveItem((int32)0)) != NULL) {
delete item;
}
}
void
MediaFileListView::SetEnabled(bool enabled)
{
if (enabled == fEnabled)
return;
fEnabled = enabled;
// TODO: visual indication of enabled status?
}
bool
MediaFileListView::IsEnabled() const
{
return fEnabled;
}
void
MediaFileListView::AddItem(BMediaFile* file, const entry_ref& ref)
{
BListView::AddItem(new MediaFileListItem(file, ref));
be_app_messenger.SendMessage(FILE_LIST_CHANGE_MESSAGE);
}
void
MediaFileListView::KeyDown(const char *bytes, int32 numBytes)
{
switch (bytes[0]) {
case B_DELETE:
if (IsEnabled()) {
int32 selection = CurrentSelection();
if (selection >= 0) {
delete RemoveItem(selection);
// select the previous item
int32 count = CountItems();
if (selection >= count)
selection = count - 1;
Select(selection);
be_app_messenger.SendMessage(FILE_LIST_CHANGE_MESSAGE);
}
}
break;
default:
BListView::KeyDown(bytes, numBytes);
}
}
void
MediaFileListView::SelectionChanged()
{
MediaConverterWindow* win = dynamic_cast<MediaConverterWindow *>(Window());
if (win != NULL)
win->SourceFileSelectionChanged();
}
@@ -0,0 +1,47 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef MEDIA_FILE_LIST_VIEW_H
#define MEDIA_FILE_LIST_VIEW_H
#include <Entry.h>
#include <ListView.h>
class BMediaFile;
struct entry_ref;
class MediaFileListItem : public BStringItem {
public:
MediaFileListItem(BMediaFile* file, const entry_ref& ref);
virtual ~MediaFileListItem();
entry_ref fRef;
BMediaFile* fMediaFile;
};
class MediaFileListView : public BListView {
public:
MediaFileListView(BRect frame,
uint32 resizingMode);
virtual ~MediaFileListView();
protected:
virtual void KeyDown(const char *bytes, int32 numBytes);
virtual void SelectionChanged();
public:
void AddItem(BMediaFile* file, const entry_ref& ref);
void SetEnabled(bool enabled);
bool IsEnabled() const;
private:
bool fEnabled;
};
#endif //MEDIACONVERTER_H
@@ -0,0 +1,30 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef MESSAGE_CONSTANTS_H
#define MESSAGE_CONSTANTS_H
#define CONVERT_BUTTON_MESSAGE 'cVTB'
#define FORMAT_SELECT_MESSAGE 'fMTS'
#define AUDIO_CODEC_SELECT_MESSAGE 'aCSL'
#define VIDEO_CODEC_SELECT_MESSAGE 'vCSL'
#define FILE_LIST_CHANGE_MESSAGE 'fLCH'
#define START_CONVERSION_MESSAGE 'stCV'
#define CANCEL_CONVERSION_MESSAGE 'cNCV'
#define CONVERSION_DONE_MESSAGE 'cVSD'
#define OUTPUT_FOLDER_MESSAGE 'oUTF'
#define FOLDER_SELECT_MESSAGE 'sLFO'
#define OPEN_FILE_MESSAGE 'oFIL'
#define DISP_ABOUT_MESSAGE 'aBUT'
#define QUIT_MESSAGE 'qUIT'
#define PREVIEW_MESSAGE 'pVEW'
#define PRIORITY_CHANGED_MESSAGE 'cPRI'
#define VIDEO_QUALITY_CHANGED_MESSAGE 'vQCG'
#define AUDIO_QUALITY_CHANGED_MESSAGE 'aQCG'
#define SELECT_THIS_DIR_MESSAGE 'sDir'
#define INIT_FORMAT_MENUS 'iFMN'
#endif // MESSAGE_CONSTANTS_H
+70
View File
@@ -0,0 +1,70 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#include "StatusView.h"
StatusView::StatusView(BRect frame, uint32 resizingMode)
: BView(frame, "StatusView", resizingMode,
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
, fStatusString(B_EMPTY_STRING)
{
frame.OffsetTo(0, 0);
fStatusRect = frame;
// TODO: bad!
BFont font;
GetFont(&font);
font.SetSize(12);
SetFont(&font);
}
StatusView::~StatusView()
{
}
void
StatusView::AttachedToWindow()
{
rgb_color c = Parent()->LowColor();
SetViewColor(c);
SetLowColor(c);
}
void
StatusView::Draw(BRect /*update*/)
{
// TODO: placement information should be cached here
// for better performance
font_height fh;
GetFontHeight(&fh);
DrawString(fStatusString.String(),
fStatusRect.LeftBottom() + BPoint(1, -fh.descent));
}
void
StatusView::MessageReceived(BMessage* message)
{
BView::MessageReceived(message);
}
void
StatusView::SetStatus(const char* text)
{
fStatusString.SetTo(text);
Invalidate();
}
const char*
StatusView::Status()
{
return fStatusString.String();
}
+35
View File
@@ -0,0 +1,35 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef STATUS_VIEW_H
#define STATUS_VIEW_H
#include <String.h>
#include <View.h>
class StatusView : public BView {
public:
StatusView(BRect frame,
uint32 resizingMode);
virtual ~StatusView();
protected:
virtual void AttachedToWindow();
virtual void Draw(BRect update);
virtual void MessageReceived(BMessage* message);
public:
void SetStatus(const char* text);
const char* Status();
private:
BRect fStatusRect;
BString fStatusString;
};
#endif // STATUS_VIEW_H
+92
View File
@@ -0,0 +1,92 @@
// Copyright 1999, Be Incorporated. All Rights Reserved.
// Copyright 2000-2004, Jun Suzuki. All Rights Reserved.
// Copyright 2007, Stephan Aßmus. All Rights Reserved.
// This file may be used under the terms of the Be Sample Code License.
#ifndef STRINGS_H
#define STRINGS_H
#include <BeBuild.h>
#if B_BEOS_VERSION >= 0x520
typedef const char Char;
#if B_BEOS_VERSION>=0x530 // 0x530 RC3
#include <locale/Locale.h>
#else
#include <Locale.h>
#endif
#else
#define _T(str) str
typedef char Char;
#endif
#define VERSION "1.3.0"
#define SOURCE_BOX_LABEL _T("Source files")
#define INFO_BOX_LABEL _T("File details")
#define OUTPUT_BOX_LABEL _T("Output format")
#define FORMAT_LABEL _T("File format")
#define VIDEO_LABEL _T("Video encoding")
#define AUDIO_LABEL _T("Audio encoding")
//
#define OUTPUT_FOLDER_LABEL _T("Output Folder")
#define PREVIEW_BUTTON_LABEL _T("Preview")
#define START_LABEL _T("Start mSec ")
#define END_LABEL _T("End mSec ")
//
#define FORMAT_MENU_LABEL _T("Format")
#define VIDEO_MENU_LABEL _T("Video")
#define AUDIO_MENU_LABEL _T("Audio")
#define DURATION_LABEL _T("Duration:")
#define VIDEO_INFO_LABEL _T("Video:")
#define AUDIO_INFO_LABEL _T("Audio:")
#define CONVERT_LABEL _T("Convert")
#define CANCEL_LABEL _T("Cancel")
#define VIDEO_QUALITY_LABEL _T("Video quality %3d%%")
#define AUDIO_QUALITY_LABEL _T("Audio quality %3d%%")
#define SLIDER_LOW_LABEL _T("Low")
#define SLIDER_HIGH_LABEL _T("High")
#define NONE_LABEL _T("None available")
#define DROP_MEDIA_FILE_LABEL _T("Drop media files onto this window")
#define CANCELLING_LABEL _T("Cancelling")
#define ABOUT_TITLE_LABEL _T("About")
#define OK_LABEL _T("OK")
#define CONV_COMPLETE_LABEL _T("Conversion completed")
#define CONV_CANCEL_LABEL _T("Conversion cancelled")
#define SELECT_DIR_LABEL _T("Select This Directory")
#define SELECT_LABEL _T("Select")
#define SAVE_DIR_LABEL _T("MediaConverter+:SaveDirectory")
#define NO_FILE_LABEL _T("No file selected")
//
#define FILE_MENU_LABEL _T("File")
#define OPEN_MENU_LABEL _T("Open")
#define ABOUT_MENU_LABEL _T("About")
#define QUIT_MENU_LABEL _T("Quit")
#define WRITE_AUDIO_STRING _T("Writing audio track:")
#define WRITE_VIDEO_STRING _T("Writing video track:")
#define COMPLETE_STRING _T("complete")
#define OUTPUT_FILE_STRING1 _T("Output file")
#define OUTPUT_FILE_STRING2 _T("created")
#define AUDIO_SUPPORT_STRING _T("Audio quality not supported")
#define VIDEO_SUPPORT_STRING _T("Video quality not supported")
#define VIDEO_PARAMFORM_STRING _T("Video using parameters form settings")
#define CONTINUE_STRING _T("Continue")
#define FILES _T("files")
#define FILE _T("file")
#define NOTRECOGNIZE _T(" were not recognized as supported media files:")
//
#define LAUNCH_ERROR _T("Error launching: ")
#define OUTPUT_FILE_STRING3 _T("Error creating")
#define CONVERT_ERROR_STRING _T("Error converting")
#define ERROR_WRITE_VIDEO_STRING _T("Error writing video frame ")
#define ERROR_WRITE_AUDIO_STRING _T("Error writing audio frame ")
#define ERROR_READ_VIDEO_STRING _T("Error read video frame ")
#define ERROR_READ_AUDIO_STRING _T("Error read audio frame ")
#define ERROR_LOAD_STRING _T("Error loading file")
#define ENCODER_PARAMETERS _T("Encoder Parameters")
#endif // STRINGS_H
@@ -0,0 +1,56 @@
"File" "Fichier"
"Open" "Ouvrir"
"About" "A propos"
"Priority" "Priorité"
"Source files" "Fichiers sources"
"File details" "Détail du fichier"
"Output format" "Format de sortie"
"File format" "Format du fichier"
"Video encoding" "Codage Vidéo"
"Audio encoding" "Codage Audio"
"Output Folder" "Dossier de sortie"
"Preview" "Prévue"
"Start mSec " "Début (mSec)"
"End mSec " "FIn (mSec)"
"Format" "Format"
"Video" "Vidéo"
"Audio" "Audio"
"Video:" "Vidéo:"
"Audio:" "Audio:"
"Duration:" "Durée:"
"Convert" "Convertir"
"Cancel" "Annuler"
"Low" "Faible"
"High" "Haute"
"Video quality %3d%%" "QualitéVidéo %3d%%"
"Audio quality %3d%%" "QualitéAudio %3d%%"
"Drop media files onto this window" "Jeter les fichiers media dans cette fenêtre"
"None available" "Non disponible"
"Converting" "Conversion en cours"
"Conversion cancelled" "Conversion annulée"
"Conversion completed" "Conversion terminée"
"About" "A propos"
"Cancelling" "Annulation en cours"
"OK" "Ok"
"No file selected" "Aucun fichier sélectionné"
"Select This Directory" "Choisir ce dossier"
"Select" "Sélectionner"
"MediaConverter+:SaveDirectory" "MediaConverter+:DossierSauvegarde"
"Output file" "Fichier cible"
"created" "créé"
"AudioQuality doesn't support" "Qualité Audio non supportée"
"VideoQuality doesn't support" "Qualité Vidéo non supportée"
"Writing audio track:" "Ecriture de la piste audio:"
"Writing video track:" "Ecriture de la piste vidéo:"
"Error launching: " "Erreur de lancement : "
"Error creating" "Erreur de création"
"Error converting" "Erreur de conversion"
"Error writing video frame " "Erreur d'écriture de la frame vidéo"
"Error writing audio frame " "Erreur d'écriture de la frame audio"
"Error read video frame " "Erreur de lecture de la frame vidéo"
"Error read audio frame " "Erreur de lecture de la frame audio"
"complete" "terminé"
"file" "fichier"
"files" "fichiers"
"Continue" "Continuer"
" were not recognized as supported media files:" " ne sont pas reconnus comme des fichiers media supportés:"
@@ -0,0 +1,56 @@
"File" "F) File"
"Open" "A) Apri"
"About" "R) A Proposito"
"Priority" "P) Priorità"
"Source files" "Files sorgente"
"File details" "Dettagli"
"Output format" "Formato di output"
"File format" "Formato del file"
"Video encoding" "Codifica video"
"Audio encoding" "Codifica audio"
"Output Folder" "Cartella di destinazione"
"Preview" "Anteprima"
"Start mSec " "Inizio mSec"
"End mSec " "Fine mSec"
"Format" "Formato"
"Video" "Video"
"Audio" "Audio"
"Video:" "Video:"
"Audio:" "Audio:"
"Duration:" "Durata:"
"Convert" "Converti"
"Cancel" "Annulla"
"Low" "Bassa"
"High" "Alta"
"Video quality %3d%%" "Qualità video %3d%%"
"Audio quality %3d%%" "Qualità audio %3d%%"
"Drop media files onto this window" "Trascina i files multimediali in questa finestra"
"None available" "Nessuno disponibile"
"Converting" "Conversione in corso"
"Conversion cancelled" "Conversione annullata"
"Conversion completed" "Conversione completata"
"About" "A Proposito"
"Cancelling" "Interruzione"
"OK" "OK"
"No file selected" "Nessun file selezionato"
"Select This Directory" "Seleziona questa directory"
"Select" "Seleziona"
"MediaConverter+:SaveDirectory" "MediaConverter+:Directory di salvataggio"
"Output file" "File di output"
"created" "creato"
"Audio-Quality doesn't support" "Audio-Quality non supportata"
"Video-Quality doesn't support" "Video-Quality non supportata"
"Writing audio track:" "Scrittura traccia audio in corso:"
"Writing video track:" "Scrittura traccia video in corso:"
"Error launching: " "Errore lanciando: "
"Error creating" "Errore creando"
"Error converting" "Errore convertendo"
"Error writing video frame " "Errore scrivendo un frame video"
"Error writing audio frame " "Errore scrivendo un frame audio"
"Error read video frame " "Errore leggendo un frame video"
"Error read audio frame " "Errore leggendo un frame audio"
"complete" "completato"
"file" "file"
"files" "files"
"Continue" "Continua"
" were not recognized as supported media files:" "non sono stati riconosciuti come files multimediali:"
@@ -0,0 +1,56 @@
"File" "F) ファイル"
"Open" "O) 開く"
"About" "A) アプリケーション情報"
"Priority" "P) 優先度"
"Source files" "ソースファイル"
"File details" "ファイルの詳細"
"Output format" "出力形式"
"File format" "ファイル形式"
"Video encoding" "映像エンコード形式"
"Audio encoding" "音声エンコード形式"
"Output Folder" "出力フォルダ"
"Preview" "プレビュー"
"Start mSec " "開始 mSec"
"End mSec " "終了 mSec"
"Format" "形式"
"Video" "映像"
"Audio" "音声"
"Video:" "映像:"
"Audio:" "音声:"
"Duration:" "長さ:"
"Convert" "変換開始"
"Cancel" "キャンセル"
"Low" "低"
"High" "高"
"Video quality %3d%%" "画質 %3d%%"
"Audio quality %3d%%" "音質 %3d%%"
"Drop media files onto this window" "メディア・ファイルをドロップできます。"
"None available" "利用不可"
"Converting" "変寒中"
"Conversion cancelled" "変換中止"
"Conversion completed" "変換完了"
"About" "アプリケーション情報"
"Cancelling" "中止しています"
"OK" "了解"
"No file selected" "ファイル未選択"
"Select This Directory" "現在のディレクトリを選択"
"Select" "選択"
"MediaConverter+:SaveDirectory" "MediaConverter+:保存先のディレクトリ"
"Output file" "出力ファイル"
"created" "生成"
"AudioQuality doesn't support" "音質調整機能なし"
"VideoQuality doesn't support" "画質調整機能なし"
"Writing audio track:" "音声トラック書き込み中:"
"Writing video track:" "映像トラック書き込み中:"
"Error launching: " "起動エラー : "
"Error creating" "ファイル書き込みエラー "
"Error converting" "変換エラー"
"Error writing video frame " "映像トラック書き込みエラー"
"Error writing audio frame " "音声トラック書き込みエラー"
"Error read video frame " "映像トラック読み込みエラー"
"Error read audio frame " "音声トラック読み込みエラー"
"complete" "完了"
"file" "つのメディアファイル"
"files" "つのメディアファイル"
"Continue" "継続"
" were not recognized as supported media files:" "はサポート外形式のため処理できません:"