Added localization support for Cortex app.
* Fixes #7530. Change-Id: I238c4c8fe32b181a8e1a4bd688bcbe9f3a87f79f Signed-off-by: Kacper Kasper <[email protected]> Reviewed-on: https://review.haiku-os.org/c/haiku/+/3169 Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
133ebab62c
commit
2cba2d5642
+14
-8
@@ -271,14 +271,20 @@ rule AddFilesToContainer container : directoryTokens : targets : destName
|
||||
$(installTargetsVar) on $(target) += $(destTarget) ;
|
||||
TARGETS_TO_INSTALL on $(directory) += $(destTarget) ;
|
||||
|
||||
# If the target is associated with catalog files, add those, too.
|
||||
local catalogs = [ on $(target) return $(HAIKU_CATALOG_FILES) ] ;
|
||||
if $(catalogs) {
|
||||
local signature
|
||||
= [ on $(target) return $(HAIKU_CATALOG_SIGNATURE) ] ;
|
||||
AddFilesToContainer $(container)
|
||||
: $(systemDirTokens) data locale catalogs $(signature)
|
||||
: $(catalogs) ;
|
||||
# If the target and its static libraries are associated with catalog
|
||||
# files, add those, too.
|
||||
local catalogTargets = $(target) + [ on $(target) return $(NEEDLIBS) ] ;
|
||||
for catalogTarget in $(catalogTargets) {
|
||||
local catalogs
|
||||
= [ on $(catalogTarget) return $(HAIKU_CATALOG_FILES) ] ;
|
||||
if $(catalogs) {
|
||||
local signature
|
||||
= [ on $(catalogTarget)
|
||||
return $(HAIKU_CATALOG_SIGNATURE) ] ;
|
||||
AddFilesToContainer $(container)
|
||||
: $(systemDirTokens) data locale catalogs $(signature)
|
||||
: $(catalogs) ;
|
||||
}
|
||||
}
|
||||
|
||||
# If the target is associated with MIME DB entries, add those, too.
|
||||
|
||||
@@ -98,29 +98,32 @@ private:
|
||||
|
||||
#else
|
||||
|
||||
#ifndef B_CATALOG
|
||||
#define B_CATALOG BLocaleRoster::Default()->GetCatalog()
|
||||
#endif
|
||||
|
||||
// Translation macros which may be used to shorten translation requests:
|
||||
#undef B_TRANSLATE
|
||||
#define B_TRANSLATE(string) \
|
||||
BLocaleRoster::Default()->GetCatalog()->GetString((string), \
|
||||
B_TRANSLATION_CONTEXT)
|
||||
B_CATALOG->GetString((string), B_TRANSLATION_CONTEXT)
|
||||
|
||||
#undef B_TRANSLATE_CONTEXT
|
||||
#define B_TRANSLATE_CONTEXT(string, context) \
|
||||
BLocaleRoster::Default()->GetCatalog()->GetString((string), (context))
|
||||
B_CATALOG->GetString((string), (context))
|
||||
|
||||
#undef B_TRANSLATE_COMMENT
|
||||
#define B_TRANSLATE_COMMENT(string, comment) \
|
||||
BLocaleRoster::Default()->GetCatalog()->GetString((string), \
|
||||
B_CATALOG->GetString((string), \
|
||||
B_TRANSLATION_CONTEXT, (comment))
|
||||
|
||||
#undef B_TRANSLATE_ALL
|
||||
#define B_TRANSLATE_ALL(string, context, comment) \
|
||||
BLocaleRoster::Default()->GetCatalog()->GetString((string), (context), \
|
||||
B_CATALOG->GetString((string), (context), \
|
||||
(comment))
|
||||
|
||||
#undef B_TRANSLATE_ID
|
||||
#define B_TRANSLATE_ID(id) \
|
||||
BLocaleRoster::Default()->GetCatalog()->GetString((id))
|
||||
B_CATALOG->GetString((id))
|
||||
|
||||
#undef B_TRANSLATE_SYSTEM_NAME
|
||||
#define B_TRANSLATE_SYSTEM_NAME(string) \
|
||||
|
||||
@@ -35,12 +35,16 @@
|
||||
#include "AddOnHostProtocol.h"
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
#include <Debug.h>
|
||||
#include <MediaRoster.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnHost"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
using namespace addon_host;
|
||||
|
||||
@@ -170,10 +174,11 @@ main(int argc, char** argv)
|
||||
{
|
||||
App app;
|
||||
if (argc < 2 || strcmp(argv[1], "--addon-host") != 0) {
|
||||
BAlert* alert = new BAlert("Cortex AddOnHost",
|
||||
"This program runs in the background, and is started automatically "
|
||||
"by Cortex when necessary. You probably don't want to start it manually.",
|
||||
"Continue", "Quit");
|
||||
BAlert* alert = new BAlert(B_TRANSLATE("Cortex AddOnHost"),
|
||||
B_TRANSLATE("This program runs in the background, and is started "
|
||||
"automatically by Cortex when necessary. You probably don't "
|
||||
"want to start it manually."),
|
||||
B_TRANSLATE("Continue"), B_TRANSLATE("Quit"));
|
||||
alert->SetShortcut(1, B_ESCAPE);
|
||||
int32 response = alert->Go();
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@ SubDirCcFlags -DCORTEX_NAMESPACE=cortex ;
|
||||
|
||||
Application CortexAddOnHost :
|
||||
AddOnHostApp.cpp
|
||||
: be media [ TargetLibstdc++ ] cortex_support.a
|
||||
: be media localestub [ TargetLibstdc++ ] cortex_support.a
|
||||
: AddOnHost_Resource.rdef
|
||||
;
|
||||
|
||||
DoCatalogs CortexAddOnHost :
|
||||
application/x-vnd.Cortex.AddOnHost
|
||||
:
|
||||
AddOnHostApp.cpp
|
||||
;
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
|
||||
// Application Kit
|
||||
#include <Application.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// Interface Kit
|
||||
#include <PopUpMenu.h>
|
||||
#include <MenuItem.h>
|
||||
@@ -48,6 +52,9 @@
|
||||
#include <MediaRoster.h>
|
||||
#include <MediaAddOn.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexDormantNodeListItem"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
@@ -56,6 +63,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_OPERATION(x) //PRINT (x) // operations
|
||||
#define D_COMPARE(x) //PRINT (x) // compare functions
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.DormantNodeView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -267,7 +276,7 @@ void DormantNodeListItem::showContextMenu(
|
||||
|
||||
// Add the "Get Info" item
|
||||
BMessage *message = new BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
|
||||
menu->AddItem(new BMenuItem("Get info", message));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"), message));
|
||||
|
||||
menu->SetTargetForItems(owner);
|
||||
owner->ConvertToScreen(&point);
|
||||
|
||||
@@ -40,10 +40,17 @@
|
||||
|
||||
// Application Kit
|
||||
#include <Application.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// Interface Kit
|
||||
#include <Screen.h>
|
||||
#include <ScrollBar.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexDormantNodeWindow"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
@@ -52,6 +59,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_MESSAGE(x) //PRINT (x) // MessageReceived()
|
||||
#define D_INTERNAL(x) //PRINT (x) // internal operations
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.DormantNodeView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -65,7 +74,8 @@ const BRect DormantNodeWindow::s_initFrame(500.0, 350.0, 640.0, 480.0);
|
||||
|
||||
DormantNodeWindow::DormantNodeWindow(
|
||||
BWindow* parent)
|
||||
: BWindow(s_initFrame, "Media add-ons",
|
||||
: BWindow(s_initFrame,
|
||||
B_TRANSLATE("Media add-ons"),
|
||||
B_FLOATING_WINDOW_LOOK,
|
||||
B_FLOATING_SUBSET_WINDOW_FEEL,
|
||||
B_WILL_ACCEPT_FIRST_CLICK|B_AVOID_FOCUS|B_ASYNCHRONOUS_CONTROLS),
|
||||
|
||||
@@ -14,3 +14,10 @@ StaticLibrary cortex_dormant_node_view.a :
|
||||
DormantNodeView.cpp
|
||||
DormantNodeWindow.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_dormant_node_view.a :
|
||||
application/x-vnd.Cortex.DormantNodeView
|
||||
:
|
||||
DormantNodeListItem.cpp
|
||||
DormantNodeWindow.cpp
|
||||
;
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
|
||||
// Application Kit
|
||||
#include <Roster.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// Media Kit
|
||||
#include <MediaNode.h>
|
||||
#include <MediaRoster.h>
|
||||
@@ -49,11 +53,16 @@
|
||||
#include <File.h>
|
||||
#include <Path.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "AppNodeInfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** ctor/dtor (public)
|
||||
// -------------------------------------------------------- //
|
||||
@@ -65,8 +74,9 @@ AppNodeInfoView::AppNodeInfoView(
|
||||
D_METHOD(("AppNodeInfoView::AppNodeInfoView()\n"));
|
||||
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" File Format ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSubTitle("Application-Owned Node");
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("File format"))
|
||||
+ 2 * InfoView::M_H_MARGIN);
|
||||
setSubTitle(B_TRANSLATE("Application-owned node"));
|
||||
|
||||
// add separator
|
||||
addField("", "");
|
||||
@@ -82,7 +92,7 @@ AppNodeInfoView::AppNodeInfoView(
|
||||
if ((appEntry.InitCheck() == B_OK)
|
||||
&& (appEntry.GetName(appName) == B_OK))
|
||||
{
|
||||
addField("Application", appName);
|
||||
addField(B_TRANSLATE("Application"), appName);
|
||||
}
|
||||
BFile appFile(&appInfo.ref, B_READ_ONLY);
|
||||
if (appFile.InitCheck() == B_OK)
|
||||
@@ -93,11 +103,11 @@ AppNodeInfoView::AppNodeInfoView(
|
||||
version_info appVersion;
|
||||
if (appFileInfo.GetVersionInfo(&appVersion, B_APP_VERSION_KIND) == B_OK)
|
||||
{
|
||||
addField("Version", appVersion.long_info);
|
||||
addField(B_TRANSLATE("Version"), appVersion.long_info);
|
||||
}
|
||||
}
|
||||
}
|
||||
addField("Signature", appInfo.signature);
|
||||
addField(B_TRANSLATE("Signature"), appInfo.signature);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,28 +40,37 @@
|
||||
// NodeManager
|
||||
#include "Connection.h"
|
||||
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// MediaKit
|
||||
#include <MediaDefs.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "ConnectionInfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
#define D_MESSAGE(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** ctor/dtor (public)
|
||||
// -------------------------------------------------------- //
|
||||
|
||||
ConnectionInfoView::ConnectionInfoView(
|
||||
const Connection &connection)
|
||||
: InfoView("Connection", "", 0),
|
||||
: InfoView(B_TRANSLATE("Connection"), "", 0),
|
||||
m_source(connection.source()),
|
||||
m_destination(connection.destination())
|
||||
{
|
||||
D_METHOD(("ConnectionInfoView::ConnectionInfoView()\n"));
|
||||
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Destination ")
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("Destination"))
|
||||
+ 2 * InfoView::M_H_MARGIN);
|
||||
media_input input;
|
||||
media_output output;
|
||||
@@ -72,7 +81,7 @@ ConnectionInfoView::ConnectionInfoView(
|
||||
if (s.Length() > 0)
|
||||
s << " ";
|
||||
s << "(" << MediaString::getStringFor(output.source) << ")";
|
||||
addField("Source", s);
|
||||
addField(B_TRANSLATE("Source"), s);
|
||||
}
|
||||
if (connection.getInput(&input) == B_OK) {
|
||||
// add "Destination" field
|
||||
@@ -81,14 +90,15 @@ ConnectionInfoView::ConnectionInfoView(
|
||||
if (s.Length() > 0)
|
||||
s << " ";
|
||||
s << "(" << MediaString::getStringFor(input.destination) << ")";
|
||||
addField("Destination", s);
|
||||
addField(B_TRANSLATE("Destination"), s);
|
||||
}
|
||||
|
||||
// add a separator field
|
||||
addField("", "");
|
||||
|
||||
// add "Media Type" field
|
||||
addField("Media Type", MediaString::getStringFor(connection.format().type));
|
||||
addField(B_TRANSLATE("Media type"),
|
||||
MediaString::getStringFor(connection.format().type));
|
||||
|
||||
// add the format fields
|
||||
_addFormatFields(connection.format());
|
||||
@@ -110,111 +120,116 @@ void ConnectionInfoView::_addFormatFields(
|
||||
switch (format.type) {
|
||||
case B_MEDIA_RAW_AUDIO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Sample Rate ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Sample rate")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add "Format" field
|
||||
s = MediaString::forAudioFormat(format.u.raw_audio.format,
|
||||
format.u.raw_audio.valid_bits);
|
||||
addField("Format", s);
|
||||
addField(B_TRANSLATE("Format"), s);
|
||||
// add "Sample Rate" field
|
||||
s = MediaString::forAudioFrameRate(format.u.raw_audio.frame_rate);
|
||||
addField("Sample Rate", s);
|
||||
addField(B_TRANSLATE("Sample rate"), s);
|
||||
// add "Channels" field
|
||||
s = MediaString::forAudioChannelCount(format.u.raw_audio.channel_count);
|
||||
addField("Channels", s);
|
||||
addField(B_TRANSLATE("Channels"), s);
|
||||
// add "Channel Mask" field
|
||||
s = MediaString::forAudioChannelMask(format.u.raw_audio.channel_mask);
|
||||
addField("Channel Mask", s);
|
||||
addField(B_TRANSLATE("Channel mask"), s);
|
||||
// add "Matrix Mask" field
|
||||
s = MediaString::forAudioMatrixMask(format.u.raw_audio.matrix_mask);
|
||||
addField("Matrix Mask", s);
|
||||
addField(B_TRANSLATE("Matrix mask"), s);
|
||||
// add the "Byte Order" field
|
||||
s = MediaString::forAudioByteOrder(format.u.raw_audio.byte_order);
|
||||
addField("Byte Order", s);
|
||||
addField(B_TRANSLATE("Byte order"), s);
|
||||
// add the "Buffer Size" field
|
||||
s = MediaString::forAudioBufferSize(format.u.raw_audio.buffer_size);
|
||||
addField("Buffer Size", s);
|
||||
addField(B_TRANSLATE("Buffer size"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_RAW_VIDEO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Video Data Between ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Video data between")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Format" field
|
||||
s = MediaString::forVideoFormat(format.u.raw_video.display.format);
|
||||
addField("Format", s);
|
||||
addField(B_TRANSLATE("Format"), s);
|
||||
// add the "Resolution" field
|
||||
s = MediaString::forVideoResolution(format.u.raw_video.display.line_width,
|
||||
format.u.raw_video.display.line_count);
|
||||
addField("Resolution", s);
|
||||
addField(B_TRANSLATE("Resolution"), s);
|
||||
// add the "Field Rate" field
|
||||
s = MediaString::forVideoFieldRate(format.u.raw_video.field_rate,
|
||||
format.u.raw_video.interlace);
|
||||
addField("Field Rate", s);
|
||||
addField(B_TRANSLATE("Field rate"), s);
|
||||
// add the "Orientation" field
|
||||
s = MediaString::forVideoOrientation(format.u.raw_video.orientation);
|
||||
addField("Orientation", s);
|
||||
addField(B_TRANSLATE("Orientation"), s);
|
||||
// add the "Aspect Ratio" field
|
||||
s = MediaString::forVideoAspectRatio(format.u.raw_video.pixel_width_aspect,
|
||||
format.u.raw_video.pixel_height_aspect);
|
||||
addField("Aspect Ratio", s);
|
||||
addField(B_TRANSLATE("Aspect ratio"), s);
|
||||
// add the "Active Lines" field
|
||||
s = MediaString::forVideoActiveLines(format.u.raw_video.first_active,
|
||||
format.u.raw_video.last_active);
|
||||
addField("Active Lines", s);
|
||||
addField(B_TRANSLATE("Active lines"), s);
|
||||
// add the "Offset" field
|
||||
s = MediaString::forVideoOffset(format.u.raw_video.display.pixel_offset,
|
||||
format.u.raw_video.display.line_offset);
|
||||
addField("Offset", s);
|
||||
addField(B_TRANSLATE("Offset"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_ENCODED_AUDIO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Frame Size ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Frame size")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Bit Rate" field
|
||||
s = MediaString::forAudioBitRate(format.u.encoded_audio.bit_rate);
|
||||
addField("Bit Rate", s);
|
||||
addField(B_TRANSLATE("Bit rate"), s);
|
||||
// add the "Frame Size" field
|
||||
s = MediaString::forAudioFrameSize(format.u.encoded_audio.frame_size);
|
||||
addField("Frame Size", s);
|
||||
addField(B_TRANSLATE("Frame size"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_ENCODED_VIDEO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Frame Size ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Frame size")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Bit Rate" field
|
||||
s = MediaString::forVideoBitRate(format.u.encoded_video.avg_bit_rate,
|
||||
format.u.encoded_video.max_bit_rate);
|
||||
addField("Bit Rate", s);
|
||||
addField(B_TRANSLATE("Bit rate"), s);
|
||||
// add the "Frame Size" field
|
||||
s = MediaString::forVideoFrameSize(format.u.encoded_video.frame_size);
|
||||
addField("Frame Size", s);
|
||||
addField(B_TRANSLATE("Frame size"), s);
|
||||
// add the "History" field
|
||||
s = MediaString::forVideoHistory(format.u.encoded_video.forward_history,
|
||||
format.u.encoded_video.backward_history);
|
||||
addField("History", s);
|
||||
addField(B_TRANSLATE("History"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_MULTISTREAM: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Chunk Size ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Chunk size")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Format" field
|
||||
s = MediaString::forMultistreamFormat(format.u.multistream.format);
|
||||
addField("Format", s);
|
||||
addField(B_TRANSLATE("Format"), s);
|
||||
// add the "Bit Rate" field
|
||||
s = MediaString::forMultistreamBitRate(format.u.multistream.avg_bit_rate,
|
||||
format.u.multistream.max_bit_rate);
|
||||
addField("Bit Rate", s);
|
||||
addField(B_TRANSLATE("Bit rate"), s);
|
||||
// add the "Chunk Size" field
|
||||
s = MediaString::forMultistreamChunkSize(format.u.multistream.avg_chunk_size,
|
||||
format.u.multistream.max_chunk_size);
|
||||
addField("Chunk Size", s);
|
||||
addField(B_TRANSLATE("Chunk size"), s);
|
||||
// add the "Flags" field
|
||||
s = MediaString::forMultistreamFlags(format.u.multistream.flags);
|
||||
addField("Flags", s);
|
||||
addField(B_TRANSLATE("Flags"), s);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -38,22 +38,31 @@
|
||||
#include "MediaIcon.h"
|
||||
#include "MediaString.h"
|
||||
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// Media Kit
|
||||
#include <MediaAddOn.h>
|
||||
#include <MediaRoster.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "DormantNodeInfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** ctor/dtor (public)
|
||||
// -------------------------------------------------------- //
|
||||
|
||||
DormantNodeInfoView::DormantNodeInfoView(
|
||||
const dormant_node_info &info)
|
||||
: InfoView(info.name, "Dormant media node",
|
||||
: InfoView(info.name, B_TRANSLATE("Dormant media node"),
|
||||
new MediaIcon(info, B_LARGE_ICON)),
|
||||
m_addOnID(info.addon),
|
||||
m_flavorID(info.flavor_id)
|
||||
@@ -61,19 +70,20 @@ DormantNodeInfoView::DormantNodeInfoView(
|
||||
D_METHOD(("DormantNodeInfoView::DormantNodeInfoView()\n"));
|
||||
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Output Formats ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("Output formats"))
|
||||
+ 2 * InfoView::M_H_MARGIN);
|
||||
|
||||
BString s;
|
||||
|
||||
// add the "AddOn ID" field
|
||||
s = "";
|
||||
s << info.addon;
|
||||
addField("AddOn ID", s);
|
||||
addField(B_TRANSLATE("AddOn ID"), s);
|
||||
|
||||
// add the "Flavor ID" field
|
||||
s = "";
|
||||
s << info.flavor_id;
|
||||
addField("Flavor ID", s);
|
||||
addField(B_TRANSLATE("Flavor ID"), s);
|
||||
|
||||
// add separator field
|
||||
addField("", "");
|
||||
@@ -84,13 +94,14 @@ DormantNodeInfoView::DormantNodeInfoView(
|
||||
{
|
||||
// add the "Description" field
|
||||
s = flavorInfo.info;
|
||||
addField("Description", s);
|
||||
addField(B_TRANSLATE("Description"), s);
|
||||
|
||||
// add "Kinds" field
|
||||
addField("Kinds", MediaString::getStringFor(static_cast<node_kind>(flavorInfo.kinds)));
|
||||
addField(B_TRANSLATE("Kinds"), MediaString::getStringFor(
|
||||
static_cast<node_kind>(flavorInfo.kinds)));
|
||||
|
||||
// add "Flavor Flags" field
|
||||
addField("Flavor flags", "?");
|
||||
addField(B_TRANSLATE("Flavor flags"), "?");
|
||||
|
||||
// add "Max. instances" field
|
||||
if (flavorInfo.possible_count > 0)
|
||||
@@ -100,20 +111,21 @@ DormantNodeInfoView::DormantNodeInfoView(
|
||||
}
|
||||
else
|
||||
{
|
||||
s = "Any number";
|
||||
s = B_TRANSLATE_COMMENT("Any number", "For 'Max. instances' field");
|
||||
}
|
||||
addField("Max. instances", s);
|
||||
addField(B_TRANSLATE("Max. instances"), s);
|
||||
|
||||
// add "Input Formats" field
|
||||
if (flavorInfo.in_format_count > 0)
|
||||
{
|
||||
if (flavorInfo.in_format_count == 1)
|
||||
{
|
||||
addField("Input format", MediaString::getStringFor(flavorInfo.in_formats[0], false));
|
||||
addField(B_TRANSLATE("Input format"),
|
||||
MediaString::getStringFor(flavorInfo.in_formats[0], false));
|
||||
}
|
||||
else
|
||||
{
|
||||
addField("Input formats", "");
|
||||
addField(B_TRANSLATE("Input formats"), "");
|
||||
for (int32 i = 0; i < flavorInfo.in_format_count; i++)
|
||||
{
|
||||
s = "";
|
||||
@@ -128,11 +140,13 @@ DormantNodeInfoView::DormantNodeInfoView(
|
||||
{
|
||||
if (flavorInfo.out_format_count == 1)
|
||||
{
|
||||
addField("Output format", MediaString::getStringFor(flavorInfo.out_formats[0], false));
|
||||
addField(B_TRANSLATE("Output format"),
|
||||
MediaString::getStringFor(
|
||||
flavorInfo.out_formats[0], false));
|
||||
}
|
||||
else
|
||||
{
|
||||
addField("Output formats", "");
|
||||
addField(B_TRANSLATE("Output formats"), "");
|
||||
for (int32 i = 0; i < flavorInfo.out_format_count; i++)
|
||||
{
|
||||
s = "";
|
||||
|
||||
@@ -38,63 +38,78 @@
|
||||
#include "MediaIcon.h"
|
||||
#include "MediaString.h"
|
||||
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "EndpointInfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** ctor/dtor (public)
|
||||
// -------------------------------------------------------- //
|
||||
|
||||
EndPointInfoView::EndPointInfoView(
|
||||
const media_input &input)
|
||||
: InfoView(input.name, "Media input", 0),
|
||||
: InfoView(input.name, B_TRANSLATE("Media input"), 0),
|
||||
m_output(false),
|
||||
m_port(input.destination.port),
|
||||
m_id(input.destination.id) {
|
||||
D_METHOD(("EndPointInfoView::EndPointInfoView(input)\n"));
|
||||
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Destination ")
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("Destination"))
|
||||
+ 2 * InfoView::M_H_MARGIN);
|
||||
|
||||
// add "Source" field
|
||||
addField("Source", MediaString::getStringFor(input.source));
|
||||
addField(B_TRANSLATE("Source"), MediaString::getStringFor(input.source));
|
||||
|
||||
// add "Destination" field
|
||||
addField("Destination", MediaString::getStringFor(input.destination));
|
||||
addField(B_TRANSLATE("Destination"),
|
||||
MediaString::getStringFor(input.destination));
|
||||
|
||||
// add a separator field
|
||||
addField("", "");
|
||||
|
||||
// add "Media Type" field
|
||||
addField("Media type", MediaString::getStringFor(input.format.type));
|
||||
addField(B_TRANSLATE("Media type"),
|
||||
MediaString::getStringFor(input.format.type));
|
||||
|
||||
_addFormatFields(input.format);
|
||||
}
|
||||
|
||||
EndPointInfoView::EndPointInfoView(
|
||||
const media_output &output)
|
||||
: InfoView(output.name, "Media output", 0),
|
||||
: InfoView(output.name, B_TRANSLATE("Media output"), 0),
|
||||
m_output(true),
|
||||
m_port(output.source.port),
|
||||
m_id(output.source.id) {
|
||||
D_METHOD(("EndPointInfoView::EndPointInfoView(output)\n"));
|
||||
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Destination ")
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("Destination"))
|
||||
+ 2 * InfoView::M_H_MARGIN);
|
||||
|
||||
// add "Source" field
|
||||
addField("Source", MediaString::getStringFor(output.source));
|
||||
addField(B_TRANSLATE("Source"),
|
||||
MediaString::getStringFor(output.source));
|
||||
|
||||
// add "Destination" field
|
||||
addField("Destination", MediaString::getStringFor(output.destination));
|
||||
addField(B_TRANSLATE("Destination"),
|
||||
MediaString::getStringFor(output.destination));
|
||||
|
||||
// add a separator field
|
||||
addField("", "");
|
||||
|
||||
// add "Media Type" field
|
||||
addField("Media type", MediaString::getStringFor(output.format.type));
|
||||
addField(B_TRANSLATE("Media type"),
|
||||
MediaString::getStringFor(output.format.type));
|
||||
|
||||
_addFormatFields(output.format);
|
||||
}
|
||||
@@ -140,111 +155,116 @@ void EndPointInfoView::_addFormatFields(
|
||||
switch (format.type) {
|
||||
case B_MEDIA_RAW_AUDIO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Sample Rate ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Sample rate")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add "Format" field
|
||||
s = MediaString::forAudioFormat(format.u.raw_audio.format,
|
||||
format.u.raw_audio.valid_bits);
|
||||
addField("Format", s);
|
||||
addField(B_TRANSLATE("Format"), s);
|
||||
// add "Sample Rate" field
|
||||
s = MediaString::forAudioFrameRate(format.u.raw_audio.frame_rate);
|
||||
addField("Sample rate", s);
|
||||
addField(B_TRANSLATE("Sample rate"), s);
|
||||
// add "Channels" field
|
||||
s = MediaString::forAudioChannelCount(format.u.raw_audio.channel_count);
|
||||
addField("Channels", s);
|
||||
addField(B_TRANSLATE("Channels"), s);
|
||||
// add "Channel Mask" field
|
||||
s = MediaString::forAudioChannelMask(format.u.raw_audio.channel_mask);
|
||||
addField("Channel mask", s);
|
||||
addField(B_TRANSLATE("Channel mask"), s);
|
||||
// add "Matrix Mask" field
|
||||
s = MediaString::forAudioMatrixMask(format.u.raw_audio.matrix_mask);
|
||||
addField("Matrix mask", s);
|
||||
addField(B_TRANSLATE("Matrix mask"), s);
|
||||
// add the "Byte Order" field
|
||||
s = MediaString::forAudioByteOrder(format.u.raw_audio.byte_order);
|
||||
addField("Byte order", s);
|
||||
addField(B_TRANSLATE("Byte order"), s);
|
||||
// add the "Buffer Size" field
|
||||
s = MediaString::forAudioBufferSize(format.u.raw_audio.buffer_size);
|
||||
addField("Buffer size", s);
|
||||
addField(B_TRANSLATE("Buffer size"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_RAW_VIDEO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Video Data Between ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Video data between")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Format" field
|
||||
s = MediaString::forVideoFormat(format.u.raw_video.display.format);
|
||||
addField("Format", s);
|
||||
addField(B_TRANSLATE("Format"), s);
|
||||
// add the "Resolution" field
|
||||
s = MediaString::forVideoResolution(format.u.raw_video.display.line_width,
|
||||
format.u.raw_video.display.line_count);
|
||||
addField("Resolution", s);
|
||||
addField(B_TRANSLATE("Resolution"), s);
|
||||
// add the "Field Rate" field
|
||||
s = MediaString::forVideoFieldRate(format.u.raw_video.field_rate,
|
||||
format.u.raw_video.interlace);
|
||||
addField("Field rate", s);
|
||||
addField(B_TRANSLATE("Field rate"), s);
|
||||
// add the "Orientation" field
|
||||
s = MediaString::forVideoOrientation(format.u.raw_video.orientation);
|
||||
addField("Orientation", s);
|
||||
addField(B_TRANSLATE("Orientation"), s);
|
||||
// add the "Aspect Ratio" field
|
||||
s = MediaString::forVideoAspectRatio(format.u.raw_video.pixel_width_aspect,
|
||||
format.u.raw_video.pixel_height_aspect);
|
||||
addField("Aspect ratio", s);
|
||||
addField(B_TRANSLATE("Aspect ratio"), s);
|
||||
// add the "Active Lines" field
|
||||
s = MediaString::forVideoActiveLines(format.u.raw_video.first_active,
|
||||
format.u.raw_video.last_active);
|
||||
addField("Active lines", s);
|
||||
addField(B_TRANSLATE("Active lines"), s);
|
||||
// add the "Offset" field
|
||||
s = MediaString::forVideoOffset(format.u.raw_video.display.pixel_offset,
|
||||
format.u.raw_video.display.line_offset);
|
||||
addField("Offset", s);
|
||||
addField(B_TRANSLATE("Offset"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_ENCODED_AUDIO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Frame Size ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Frame size")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Bit Rate" field
|
||||
s = MediaString::forAudioBitRate(format.u.encoded_audio.bit_rate);
|
||||
addField("Bit rate", s);
|
||||
addField(B_TRANSLATE("Bit rate"), s);
|
||||
// add the "Frame Size" field
|
||||
s = MediaString::forAudioFrameSize(format.u.encoded_audio.frame_size);
|
||||
addField("Frame size", s);
|
||||
addField(B_TRANSLATE("Frame size"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_ENCODED_VIDEO: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Frame Size ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Frame size")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Bit Rate" field
|
||||
s = MediaString::forVideoBitRate(format.u.encoded_video.avg_bit_rate,
|
||||
format.u.encoded_video.max_bit_rate);
|
||||
addField("Bit rate", s);
|
||||
addField(B_TRANSLATE("Bit rate"), s);
|
||||
// add the "Frame Size" field
|
||||
s = MediaString::forVideoFrameSize(format.u.encoded_video.frame_size);
|
||||
addField("Frame size", s);
|
||||
addField(B_TRANSLATE("Frame size"), s);
|
||||
// add the "History" field
|
||||
s = MediaString::forVideoHistory(format.u.encoded_video.forward_history,
|
||||
format.u.encoded_video.backward_history);
|
||||
addField("History", s);
|
||||
addField(B_TRANSLATE("History"), s);
|
||||
break;
|
||||
}
|
||||
case B_MEDIA_MULTISTREAM: {
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Chunk Size ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(
|
||||
B_TRANSLATE("Chunk size")) + 2 * InfoView::M_H_MARGIN);
|
||||
BString s;
|
||||
// add the "Format" field
|
||||
s = MediaString::forMultistreamFormat(format.u.multistream.format);
|
||||
addField("Format", s);
|
||||
addField(B_TRANSLATE("Format"), s);
|
||||
// add the "Bit Rate" field
|
||||
s = MediaString::forMultistreamBitRate(format.u.multistream.avg_bit_rate,
|
||||
format.u.multistream.max_bit_rate);
|
||||
addField("Bit rate", s);
|
||||
addField(B_TRANSLATE("Bit rate"), s);
|
||||
// add the "Chunk Size" field
|
||||
s = MediaString::forMultistreamChunkSize(format.u.multistream.avg_chunk_size,
|
||||
format.u.multistream.max_chunk_size);
|
||||
addField("Chunk size", s);
|
||||
addField(B_TRANSLATE("Chunk size"), s);
|
||||
// add the "Flags" field
|
||||
s = MediaString::forMultistreamFlags(format.u.multistream.flags);
|
||||
addField("Flags", s);
|
||||
addField(B_TRANSLATE("Flags"), s);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
|
||||
@@ -36,17 +36,25 @@
|
||||
#include "MediaString.h"
|
||||
#include "NodeRef.h"
|
||||
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
#include <MediaFile.h>
|
||||
#include <MediaNode.h>
|
||||
#include <MediaRoster.h>
|
||||
#include <MediaTrack.h>
|
||||
#include <TimeCode.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "FileNodeInfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** ctor/dtor (public)
|
||||
// -------------------------------------------------------- //
|
||||
@@ -58,8 +66,9 @@ FileNodeInfoView::FileNodeInfoView(
|
||||
D_METHOD(("FileNodeInfoView::FileNodeInfoView()\n"));
|
||||
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" File Format ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSubTitle("Live File-Interface Node");
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("File format"))
|
||||
+ 2 * InfoView::M_H_MARGIN);
|
||||
setSubTitle(B_TRANSLATE("Live file-interface node"));
|
||||
|
||||
// if a ref is set for this file-interface display some info
|
||||
// thru MediaFile and set the title appropriatly
|
||||
@@ -82,7 +91,7 @@ FileNodeInfoView::FileNodeInfoView(
|
||||
{
|
||||
s = "";
|
||||
s << format.pretty_name << " (" << format.mime_type << ")";
|
||||
addField("File Format", s);
|
||||
addField(B_TRANSLATE("File format"), s);
|
||||
}
|
||||
|
||||
// add "Copyright" field
|
||||
@@ -90,13 +99,13 @@ FileNodeInfoView::FileNodeInfoView(
|
||||
if (copyRight)
|
||||
{
|
||||
s = copyRight;
|
||||
addField("Copyright", s);
|
||||
addField(B_TRANSLATE("Copyright"), s);
|
||||
}
|
||||
|
||||
// add "Tracks" list
|
||||
if (file.CountTracks() > 0)
|
||||
{
|
||||
addField("Tracks", "");
|
||||
addField(B_TRANSLATE("Tracks"), "");
|
||||
for (int32 i = 0; i < file.CountTracks(); i++)
|
||||
{
|
||||
BString label;
|
||||
@@ -117,10 +126,12 @@ FileNodeInfoView::FileNodeInfoView(
|
||||
media_codec_info codec;
|
||||
if (track->GetCodecInfo(&codec) == B_OK)
|
||||
{
|
||||
s << "\n- Codec: " << codec.pretty_name;
|
||||
s << B_TRANSLATE("\n- Codec:") << " "
|
||||
<< codec.pretty_name;
|
||||
if (codec.id > 0)
|
||||
{
|
||||
s << " (ID: " << codec.id << ")";
|
||||
s << " (" << B_TRANSLATE("ID:") << " "
|
||||
<< codec.id << ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,13 +142,13 @@ FileNodeInfoView::FileNodeInfoView(
|
||||
us_to_timecode(duration, &hours, &minutes, &seconds, &frames);
|
||||
char buffer[64];
|
||||
sprintf(buffer, "%02d:%02d:%02d:%02d", hours, minutes, seconds, frames);
|
||||
s << "\n- Duration: " << buffer;
|
||||
s << B_TRANSLATE("\n- Duration:") << " " << buffer;
|
||||
|
||||
// add quality
|
||||
float quality;
|
||||
if (track->GetQuality(&quality) == B_OK)
|
||||
{
|
||||
s << "\n- Quality: " << quality;
|
||||
s << B_TRANSLATE("\n- Quality:") << " " << quality;
|
||||
}
|
||||
addField(label, s);
|
||||
}
|
||||
@@ -153,7 +164,8 @@ FileNodeInfoView::FileNodeInfoView(
|
||||
{
|
||||
// set title
|
||||
title = ref->name();
|
||||
title += " (no file)";
|
||||
title += " ";
|
||||
title += B_TRANSLATE("(no file)");
|
||||
}
|
||||
setTitle(title);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
|
||||
#include "array_delete.h"
|
||||
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// Interface Kit
|
||||
#include <Bitmap.h>
|
||||
#include <Region.h>
|
||||
@@ -48,6 +52,9 @@
|
||||
// Support Kit
|
||||
#include <List.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "InfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
@@ -56,6 +63,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_ACCESS(X) //PRINT (x) // Accessors
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** internal class: _InfoTextField
|
||||
//
|
||||
@@ -175,10 +184,10 @@ void InfoView::AttachedToWindow() {
|
||||
D_HOOK(("InfoView::AttachedToWindow()\n"));
|
||||
|
||||
// adjust the windows title
|
||||
BString title = m_title;
|
||||
title << " info";
|
||||
BString title = B_TRANSLATE("%title% info");
|
||||
title.ReplaceFirst("%title%", m_title);
|
||||
Window()->SetTitle(title.String());
|
||||
|
||||
|
||||
// calculate the area occupied by title, subtitle and icon
|
||||
font_height fh;
|
||||
be_bold_font->GetHeight(&fh);
|
||||
|
||||
@@ -17,3 +17,15 @@ StaticLibrary cortex_info_view.a :
|
||||
InfoWindowManager.cpp
|
||||
LiveNodeInfoView.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_info_view.a :
|
||||
application/x-vnd.Cortex.InfoView
|
||||
:
|
||||
AppNodeInfoView.cpp
|
||||
ConnectionInfoView.cpp
|
||||
DormantNodeInfoView.cpp
|
||||
EndPointInfoView.cpp
|
||||
FileNodeInfoView.cpp
|
||||
InfoView.cpp
|
||||
LiveNodeInfoView.cpp
|
||||
;
|
||||
|
||||
@@ -41,37 +41,47 @@
|
||||
#include "MediaIcon.h"
|
||||
#include "MediaString.h"
|
||||
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
// Media Kit
|
||||
#include <MediaNode.h>
|
||||
|
||||
// Interface Kit
|
||||
#include <Window.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "LiveNodeInfoView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
#define D_METHOD(x) //PRINT (x)
|
||||
#define D_MESSAGE(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.InfoView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** ctor/dtor (public)
|
||||
// -------------------------------------------------------- //
|
||||
|
||||
LiveNodeInfoView::LiveNodeInfoView(
|
||||
const NodeRef *ref)
|
||||
: InfoView(ref->name(), "Live Media Node",
|
||||
: InfoView(ref->name(), B_TRANSLATE("Live media node"),
|
||||
new MediaIcon(ref->nodeInfo(), B_LARGE_ICON)),
|
||||
m_nodeID(ref->id())
|
||||
{
|
||||
D_METHOD(("LiveNodeInfoView::LiveNodeInfoView()\n"));
|
||||
|
||||
// adjust view properties
|
||||
setSideBarWidth(be_plain_font->StringWidth(" Run Mode ") + 2 * InfoView::M_H_MARGIN);
|
||||
setSideBarWidth(be_plain_font->StringWidth(B_TRANSLATE("Run mode")) + 2 * InfoView::M_H_MARGIN);
|
||||
|
||||
// add "Node ID" field
|
||||
BString s;
|
||||
s << ref->id();
|
||||
addField("Node ID", s);
|
||||
addField(B_TRANSLATE("Node ID"), s);
|
||||
|
||||
// add "Port" field
|
||||
s = "";
|
||||
@@ -81,13 +91,13 @@ LiveNodeInfoView::LiveNodeInfoView(
|
||||
{
|
||||
s << " (" << portInfo.name << ")";
|
||||
}
|
||||
addField("Port", s);
|
||||
addField(B_TRANSLATE("Port"), s);
|
||||
|
||||
// add separator field
|
||||
addField("", "");
|
||||
|
||||
// add "Kinds" field
|
||||
addField("Kinds", MediaString::getStringFor(static_cast<node_kind>(ref->kind())));
|
||||
addField(B_TRANSLATE("Kinds"), MediaString::getStringFor(static_cast<node_kind>(ref->kind())));
|
||||
|
||||
// add "Run Mode" field
|
||||
BMediaNode::run_mode runMode = static_cast<BMediaNode::run_mode>(ref->runMode());
|
||||
@@ -99,7 +109,7 @@ LiveNodeInfoView::LiveNodeInfoView(
|
||||
runMode = group->runMode();
|
||||
}
|
||||
}
|
||||
addField("Run Mode", MediaString::getStringFor(runMode));
|
||||
addField(B_TRANSLATE("Run mode"), MediaString::getStringFor(runMode));
|
||||
|
||||
// add "Latency" field
|
||||
bigtime_t latency;
|
||||
@@ -114,7 +124,7 @@ LiveNodeInfoView::LiveNodeInfoView(
|
||||
{
|
||||
s = "?";
|
||||
}
|
||||
addField("Latency", s);
|
||||
addField(B_TRANSLATE("Latency"), s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
SubDir HAIKU_TOP src apps cortex ;
|
||||
|
||||
SubInclude HAIKU_TOP src apps cortex RouteApp ;
|
||||
SubInclude HAIKU_TOP src apps cortex AddOnHost ;
|
||||
|
||||
SubInclude HAIKU_TOP src apps cortex DiagramView ;
|
||||
SubInclude HAIKU_TOP src apps cortex DormantNodeView ;
|
||||
SubInclude HAIKU_TOP src apps cortex InfoView ;
|
||||
@@ -15,4 +12,7 @@ SubInclude HAIKU_TOP src apps cortex TransportView ;
|
||||
SubInclude HAIKU_TOP src apps cortex ValControl ;
|
||||
SubInclude HAIKU_TOP src apps cortex support ;
|
||||
|
||||
SubInclude HAIKU_TOP src apps cortex RouteApp ;
|
||||
SubInclude HAIKU_TOP src apps cortex AddOnHost ;
|
||||
|
||||
SubInclude HAIKU_TOP src apps cortex addons ;
|
||||
|
||||
@@ -21,3 +21,12 @@ StaticLibrary cortex_media_routing_view.a :
|
||||
MediaRoutingView.cpp
|
||||
MediaWire.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_media_routing_view.a :
|
||||
application/x-vnd.Cortex.MediaRoutingView
|
||||
:
|
||||
MediaJack.cpp
|
||||
MediaNodePanel.cpp
|
||||
MediaRoutingView.cpp
|
||||
MediaWire.cpp
|
||||
;
|
||||
|
||||
@@ -51,6 +51,13 @@
|
||||
#include <Bitmap.h>
|
||||
#include <MenuItem.h>
|
||||
#include <PopUpMenu.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "MediaJack"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
@@ -59,6 +66,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_DRAW(x) //PRINT (x)
|
||||
#define D_MOUSE(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.MediaRoutingView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -88,7 +97,7 @@ MediaJack::MediaJack(
|
||||
D_METHOD(("MediaJack::MediaJack()\n"));
|
||||
makeSelectable(false);
|
||||
if (m_label == "")
|
||||
m_label = "Input";
|
||||
m_label = B_TRANSLATE("Input");
|
||||
_updateAbbreviation();
|
||||
}
|
||||
|
||||
@@ -108,7 +117,7 @@ MediaJack::MediaJack(
|
||||
D_METHOD(("MediaJack::MediaJack()\n"));
|
||||
makeSelectable(false);
|
||||
if (m_label == "")
|
||||
m_label = "Output";
|
||||
m_label = B_TRANSLATE("Output");
|
||||
_updateAbbreviation();
|
||||
}
|
||||
|
||||
@@ -748,7 +757,7 @@ void MediaJack::showContextMenu(
|
||||
BMessage *message = new BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
|
||||
message->AddData("input", B_RAW_TYPE,
|
||||
reinterpret_cast<const void *>(&input), sizeof(input));
|
||||
menu->AddItem(new BMenuItem("Get info", message));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"), message));
|
||||
}
|
||||
else if (isOutput())
|
||||
{
|
||||
@@ -757,7 +766,7 @@ void MediaJack::showContextMenu(
|
||||
BMessage *message = new BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
|
||||
message->AddData("output", B_RAW_TYPE,
|
||||
reinterpret_cast<const void *>(&output), sizeof(output));
|
||||
menu->AddItem(new BMenuItem("Get info", message));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"), message));
|
||||
}
|
||||
|
||||
menu->SetTargetForItems(view());
|
||||
|
||||
@@ -62,6 +62,13 @@
|
||||
// Media Kit
|
||||
#include <MediaDefs.h>
|
||||
#include <MediaRoster.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "MediaNodePanel"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -72,6 +79,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_MESSAGE(x) //PRINT (x)
|
||||
#define D_DRAW(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.MediaRoutingView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -562,7 +571,8 @@ void MediaNodePanel::showContextMenu(
|
||||
|
||||
// add the "Tweak Parameters" item
|
||||
message = new BMessage(MediaRoutingView::M_NODE_TWEAK_PARAMETERS);
|
||||
menu->AddItem(item = new BMenuItem("Tweak parameters", message, 'P'));
|
||||
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Tweak parameters"),
|
||||
message, 'P'));
|
||||
if (!(ref->kind() & B_CONTROLLABLE))
|
||||
{
|
||||
item->SetEnabled(false);
|
||||
@@ -570,10 +580,11 @@ void MediaNodePanel::showContextMenu(
|
||||
|
||||
message = new BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
|
||||
message->AddInt32("nodeID", ref->id());
|
||||
menu->AddItem(new BMenuItem("Get info", message, 'I'));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"), message, 'I'));
|
||||
menu->AddSeparatorItem();
|
||||
|
||||
menu->AddItem(item = new BMenuItem("Release", new BMessage(MediaRoutingView::M_DELETE_SELECTION), 'T'));
|
||||
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Release"),
|
||||
new BMessage(MediaRoutingView::M_DELETE_SELECTION), 'T'));
|
||||
if (!ref->isInternal())
|
||||
{
|
||||
item->SetEnabled(false);
|
||||
@@ -583,7 +594,7 @@ void MediaNodePanel::showContextMenu(
|
||||
// add the "Cycle" item
|
||||
message = new BMessage(MediaRoutingView::M_NODE_CHANGE_CYCLING);
|
||||
message->AddBool("cycle", !ref->isCycling());
|
||||
menu->AddItem(item = new BMenuItem("Cycle", message));
|
||||
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Cycle"), message));
|
||||
item->SetMarked(ref->isCycling());
|
||||
if (ref->flags() & NodeRef::NO_SEEK)
|
||||
{
|
||||
@@ -591,7 +602,7 @@ void MediaNodePanel::showContextMenu(
|
||||
}
|
||||
|
||||
// add the "Run Mode" sub menu
|
||||
BMenu *subMenu = new BMenu("Run mode");
|
||||
BMenu *subMenu = new BMenu(B_TRANSLATE("Run mode"));
|
||||
subMenu->SetFont(be_plain_font);
|
||||
for (uint32 runMode = 1; runMode <= BMediaNode::B_RECORDING; runMode++)
|
||||
{
|
||||
@@ -613,7 +624,8 @@ void MediaNodePanel::showContextMenu(
|
||||
subMenu->AddSeparatorItem();
|
||||
message = new BMessage(MediaRoutingView::M_NODE_CHANGE_RUN_MODE);
|
||||
message->AddInt32("run_mode", 0);
|
||||
subMenu->AddItem(item = new BMenuItem("(same as group)", message));
|
||||
subMenu->AddItem(
|
||||
item = new BMenuItem(B_TRANSLATE("(same as group)"), message));
|
||||
if (ref->group() == 0)
|
||||
{
|
||||
item->SetEnabled(false);
|
||||
@@ -626,19 +638,19 @@ void MediaNodePanel::showContextMenu(
|
||||
subMenu->SetTargetForItems(view());
|
||||
|
||||
// [c.lenz 24dec99] hide rarely used commands in a 'Advanced' submenu
|
||||
subMenu = new BMenu("Advanced");
|
||||
subMenu = new BMenu(B_TRANSLATE("Advanced"));
|
||||
subMenu->SetFont(be_plain_font);
|
||||
// [e.moon 5dec99] ad-hoc timesource support
|
||||
if(ref->kind() & B_TIME_SOURCE) {
|
||||
message = new BMessage(MediaRoutingView::M_NODE_START_TIME_SOURCE);
|
||||
message->AddInt32("nodeID", ref->id());
|
||||
subMenu->AddItem(new BMenuItem(
|
||||
"Start time source",
|
||||
B_TRANSLATE("Start time source"),
|
||||
message));
|
||||
message = new BMessage(MediaRoutingView::M_NODE_START_TIME_SOURCE);
|
||||
message->AddInt32("nodeID", ref->id());
|
||||
subMenu->AddItem(new BMenuItem(
|
||||
"Stop time source",
|
||||
B_TRANSLATE("Stop time source"),
|
||||
message));
|
||||
}
|
||||
// [c.lenz 24dec99] support for BControllable::StartControlPanel()
|
||||
@@ -646,8 +658,8 @@ void MediaNodePanel::showContextMenu(
|
||||
if (subMenu->CountItems() > 0)
|
||||
subMenu->AddSeparatorItem();
|
||||
message = new BMessage(MediaRoutingView::M_NODE_START_CONTROL_PANEL);
|
||||
subMenu->AddItem(new BMenuItem("Start Control Panel", message,
|
||||
'P', B_COMMAND_KEY | B_SHIFT_KEY));
|
||||
subMenu->AddItem(new BMenuItem(B_TRANSLATE("Start control panel"),
|
||||
message, 'P', B_COMMAND_KEY | B_SHIFT_KEY));
|
||||
}
|
||||
// [em 1feb00] group tweaks
|
||||
if(ref->group())
|
||||
@@ -660,7 +672,8 @@ void MediaNodePanel::showContextMenu(
|
||||
subMenu->AddSeparatorItem();
|
||||
subMenu->AddItem(
|
||||
new BMenuItem(
|
||||
isLocked ? "Unlock group" : "Lock group", message));
|
||||
isLocked ? B_TRANSLATE("Unlock group")
|
||||
: B_TRANSLATE("Lock group"), message));
|
||||
}
|
||||
|
||||
if (subMenu->CountItems() > 0)
|
||||
@@ -797,8 +810,8 @@ void MediaNodePanel::_prepareLabel()
|
||||
status_t error = BMediaRoster::Roster()->GetRefFor(ref->node(), &nodeFile);
|
||||
if (error)
|
||||
{
|
||||
m_fullLabel = ref->name();
|
||||
m_fullLabel += " (no file)";
|
||||
m_fullLabel = B_TRANSLATE("%refname% (no file)");
|
||||
m_fullLabel.ReplaceFirst("%refname%", ref->name());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -62,6 +62,10 @@
|
||||
#include <MenuItem.h>
|
||||
#include <PopUpMenu.h>
|
||||
#include <Window.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
// Media Kit
|
||||
#include <MediaRoster.h>
|
||||
// Storage Kit
|
||||
@@ -72,6 +76,9 @@
|
||||
#include <BitmapStream.h>
|
||||
#include <TranslatorRoster.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "MediaRoutingView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
#include <Debug.h>
|
||||
@@ -80,6 +87,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_MOUSE(x) //PRINT (x)
|
||||
#define D_KEY(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.MediaRoutingView");
|
||||
|
||||
// ---------------------------------------------------------------- //
|
||||
// constants
|
||||
// ---------------------------------------------------------------- //
|
||||
@@ -202,7 +211,7 @@ DiagramWire *MediaRoutingView::createWire(
|
||||
error = manager->connect(output, input, &connection);
|
||||
if (error)
|
||||
{
|
||||
showErrorMessage("Could not connect", error);
|
||||
showErrorMessage(B_TRANSLATE("Could not connect"), error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,8 +280,9 @@ MediaRoutingView::MessageDropped(BPoint point, BMessage *message)
|
||||
dropPoint = message->DropPoint(&dropOffset);
|
||||
m_lastDropPoint = Align(ConvertFromScreen(dropPoint - dropOffset));
|
||||
} else {
|
||||
BString s;
|
||||
s << "Could not instantiate '" << info.name << "'";
|
||||
BString s = B_TRANSLATE(
|
||||
"Could not instantiate '%infoname%'");
|
||||
s.ReplaceFirst("%infoname%", info.name);
|
||||
showErrorMessage(s, error);
|
||||
}
|
||||
}
|
||||
@@ -944,14 +954,14 @@ void MediaRoutingView::showContextMenu(
|
||||
BMenuItem *item;
|
||||
BMessage *message = new BMessage(M_LAYOUT_CHANGED);
|
||||
message->AddInt32("layout", M_ICON_VIEW);
|
||||
menu->AddItem(item = new BMenuItem("Icon view", message));
|
||||
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Icon view"), message));
|
||||
if (m_layout == M_ICON_VIEW)
|
||||
{
|
||||
item->SetMarked(true);
|
||||
}
|
||||
message = new BMessage(M_LAYOUT_CHANGED);
|
||||
message->AddInt32("layout", M_MINI_ICON_VIEW);
|
||||
menu->AddItem(item = new BMenuItem("Mini icon view", message));
|
||||
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Mini icon view"), message));
|
||||
if (m_layout == M_MINI_ICON_VIEW)
|
||||
{
|
||||
item->SetMarked(true);
|
||||
@@ -959,10 +969,12 @@ void MediaRoutingView::showContextMenu(
|
||||
menu->AddSeparatorItem();
|
||||
|
||||
// add 'CleanUp' command
|
||||
menu->AddItem(new BMenuItem("Clean up", new BMessage(M_CLEANUP_REQUESTED), 'K'));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Clean up"),
|
||||
new BMessage(M_CLEANUP_REQUESTED), 'K'));
|
||||
|
||||
// add 'Select All' command
|
||||
menu->AddItem(new BMenuItem("Select all", new BMessage(M_SELECT_ALL), 'A'));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Select all"),
|
||||
new BMessage(M_SELECT_ALL), 'A'));
|
||||
|
||||
menu->SetTargetForItems(this);
|
||||
ConvertToScreen(&point);
|
||||
@@ -988,8 +1000,8 @@ void MediaRoutingView::showErrorMessage(
|
||||
BMessenger messenger(0, Window());
|
||||
if (!messenger.IsValid()
|
||||
|| (messenger.SendMessage(&message) != B_OK)) {
|
||||
BAlert *alert = new BAlert("Error", text.String(), "OK", 0, 0,
|
||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
BAlert *alert = new BAlert(B_TRANSLATE("Error"), text.String(),
|
||||
B_TRANSLATE("OK"), 0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
}
|
||||
@@ -1446,6 +1458,9 @@ void MediaRoutingView::_initLayout()
|
||||
{
|
||||
D_METHOD(("MediaRoutingView::_initLayout()\n"));
|
||||
|
||||
BString measure;
|
||||
measure << " " << B_TRANSLATE("Be Audio Mixer") << " ";
|
||||
|
||||
switch (m_layout)
|
||||
{
|
||||
case M_ICON_VIEW:
|
||||
@@ -1467,7 +1482,7 @@ void MediaRoutingView::_initLayout()
|
||||
font_height fh;
|
||||
be_plain_font->GetHeight(&fh);
|
||||
labelWidth = 4 * MediaNodePanel::M_LABEL_H_MARGIN
|
||||
+ be_plain_font->StringWidth(" Be Audio Mixer ");
|
||||
+ be_plain_font->StringWidth(measure.String());
|
||||
bodyWidth = 2 * MediaNodePanel::M_BODY_H_MARGIN + B_LARGE_ICON
|
||||
+ 2 * MediaJack::M_DEFAULT_WIDTH;
|
||||
labelHeight = 2 * MediaNodePanel::M_LABEL_V_MARGIN
|
||||
@@ -1490,7 +1505,7 @@ void MediaRoutingView::_initLayout()
|
||||
font_height fh;
|
||||
be_plain_font->GetHeight(&fh);
|
||||
labelWidth = 4 * MediaNodePanel::M_LABEL_H_MARGIN
|
||||
+ be_plain_font->StringWidth(" Be Audio Mixer ");
|
||||
+ be_plain_font->StringWidth(measure.String());
|
||||
bodyWidth = 2 * MediaNodePanel::M_BODY_H_MARGIN + B_MINI_ICON;
|
||||
labelHeight = 3 * MediaNodePanel::M_LABEL_V_MARGIN
|
||||
+ fh.ascent + fh.descent + fh.leading
|
||||
@@ -1534,21 +1549,21 @@ void MediaRoutingView::_initContent()
|
||||
NodeRef* videoIn = manager->videoInputNode();
|
||||
if (videoIn)
|
||||
{
|
||||
group = manager->createGroup("Video input");
|
||||
group = manager->createGroup(B_TRANSLATE("Video input"));
|
||||
group->setRunMode(BMediaNode::B_RECORDING);
|
||||
group->addNode(videoIn);
|
||||
}
|
||||
NodeRef* audioIn = manager->audioInputNode();
|
||||
if (audioIn)
|
||||
{
|
||||
group = manager->createGroup("Audio input");
|
||||
group = manager->createGroup(B_TRANSLATE("Audio input"));
|
||||
group->setRunMode(BMediaNode::B_RECORDING);
|
||||
group->addNode(audioIn);
|
||||
}
|
||||
NodeRef* videoOut = manager->videoOutputNode();
|
||||
if (videoOut)
|
||||
{
|
||||
group = manager->createGroup("Video output");
|
||||
group = manager->createGroup(B_TRANSLATE("Video output"));
|
||||
group->addNode(videoOut);
|
||||
}
|
||||
}
|
||||
@@ -1674,8 +1689,8 @@ void MediaRoutingView::_deleteSelection()
|
||||
status_t error = panel->ref->releaseNode();
|
||||
if (error)
|
||||
{
|
||||
BString s;
|
||||
s << "Could not release '" << panel->ref->name() << "'";
|
||||
BString s = B_TRANSLATE("Could not release '%refname%'");
|
||||
s.ReplaceFirst("%rename%", panel->ref->name());
|
||||
showErrorMessage(s, error);
|
||||
}
|
||||
}
|
||||
@@ -1691,7 +1706,8 @@ void MediaRoutingView::_deleteSelection()
|
||||
status_t error = manager->disconnect(wire->connection);
|
||||
if (error)
|
||||
{
|
||||
showErrorMessage("Could not disconnect", error);
|
||||
showErrorMessage(
|
||||
B_TRANSLATE("Could not disconnect"), error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1754,8 +1770,9 @@ void MediaRoutingView::_checkDroppedFile(
|
||||
char fileName[B_FILE_NAME_LENGTH];
|
||||
BEntry entry(ref);
|
||||
entry.GetName(fileName);
|
||||
BString s;
|
||||
s << "Could not load '" << fileName << "'";
|
||||
BString s = B_TRANSLATE(
|
||||
"Could not load '%filename%'");
|
||||
s.ReplaceFirst("%filename%", fileName);
|
||||
showErrorMessage(s, error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,13 @@
|
||||
#include <PopUpMenu.h>
|
||||
// Media Kit
|
||||
#include <MediaDefs.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "MediaRoutingView"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
@@ -59,6 +66,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_DRAW(x) //PRINT (x)
|
||||
#define D_MOUSE(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.MediaRoutingView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -322,10 +331,11 @@ void MediaWire::showContextMenu(
|
||||
BMessage *message = new BMessage(InfoWindowManager::M_INFO_WINDOW_REQUESTED);
|
||||
message->AddData("connection", B_RAW_TYPE,
|
||||
reinterpret_cast<const void *>(&output), sizeof(output));
|
||||
menu->AddItem(new BMenuItem("Get info", message, 'I'));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Get info"), message, 'I'));
|
||||
|
||||
// add the "Disconnect" item
|
||||
menu->AddItem(item = new BMenuItem("Disconnect", new BMessage(MediaRoutingView::M_DELETE_SELECTION), 'T'));
|
||||
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Disconnect"),
|
||||
new BMessage(MediaRoutingView::M_DELETE_SELECTION), 'T'));
|
||||
if (connection.flags() & Connection::LOCKED)
|
||||
{
|
||||
item->SetEnabled(false);
|
||||
|
||||
@@ -14,3 +14,9 @@ StaticLibrary cortex_node_manager.a :
|
||||
NodeRef.cpp
|
||||
NodeSyncThread.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_node_manager.a :
|
||||
application/x-vnd.Cortex.NodeManager
|
||||
:
|
||||
NodeManager.cpp
|
||||
;
|
||||
|
||||
@@ -46,6 +46,13 @@
|
||||
#include <functional>
|
||||
#include <list>
|
||||
#include <set>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "NodeManager"
|
||||
|
||||
#include "set_tools.h"
|
||||
#include "functional_tools.h"
|
||||
@@ -61,6 +68,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_ROSTER(x) //PRINT (x)
|
||||
#define D_LOCK(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.NodeManager");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// messaging constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -406,12 +415,18 @@ NodeManager::~NodeManager() {
|
||||
//
|
||||
}
|
||||
|
||||
const char* const NodeManager::s_defaultGroupPrefix = "No Name";
|
||||
const char* const NodeManager::s_timeSourceGroup = "Time Sources";
|
||||
const char* const NodeManager::s_audioInputGroup = "System Audio Input";
|
||||
const char* const NodeManager::s_videoInputGroup = "System Video Input";
|
||||
const char* const NodeManager::s_audioMixerGroup = "System Audio Mixer";
|
||||
const char* const NodeManager::s_videoOutputGroup = "System Video Output";
|
||||
const char* const
|
||||
NodeManager::s_defaultGroupPrefix = B_TRANSLATE("No name");
|
||||
const char* const
|
||||
NodeManager::s_timeSourceGroup = B_TRANSLATE("Time sources");
|
||||
const char* const
|
||||
NodeManager::s_audioInputGroup = B_TRANSLATE("System audio input");
|
||||
const char* const
|
||||
NodeManager::s_videoInputGroup = B_TRANSLATE("System video input");
|
||||
const char* const
|
||||
NodeManager::s_audioMixerGroup = B_TRANSLATE("System audio mixer");
|
||||
const char* const
|
||||
NodeManager::s_videoOutputGroup = B_TRANSLATE("System video output");
|
||||
|
||||
NodeManager::NodeManager(
|
||||
bool useAddOnHost) :
|
||||
|
||||
@@ -11,3 +11,9 @@ StaticLibrary cortex_parameter_view.a :
|
||||
ParameterWindow.cpp
|
||||
ParameterContainerView.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_parameter_view.a :
|
||||
application/x-vnd.Cortex.ParameterView
|
||||
:
|
||||
ParameterWindow.cpp
|
||||
;
|
||||
|
||||
@@ -54,6 +54,13 @@
|
||||
#include <Path.h>
|
||||
// Support Kit
|
||||
#include <String.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "ParameterWindow"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
@@ -63,6 +70,8 @@ __USE_CORTEX_NAMESPACE
|
||||
#define D_INTERNAL(x) //PRINT (x)
|
||||
#define D_MESSAGE(x) //PRINT (x)
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.ParameterView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// ctor/dtor
|
||||
// -------------------------------------------------------- //
|
||||
@@ -83,26 +92,25 @@ ParameterWindow::ParameterWindow(
|
||||
|
||||
// add the nodes name to the title
|
||||
{
|
||||
char* title = new char[strlen(nodeInfo.name) + strlen(" parameters") + 1];
|
||||
sprintf(title, "%s parameters", nodeInfo.name);
|
||||
BString title = B_TRANSLATE("%nodeinfo% parameters");
|
||||
title.ReplaceFirst("%nodeinfo%", nodeInfo.name);
|
||||
SetTitle(title);
|
||||
delete [] title;
|
||||
}
|
||||
// add the menu bar
|
||||
BMenuBar *menuBar = new BMenuBar(Bounds(), "ParameterWindow MenuBar");
|
||||
|
||||
BMenu *menu = new BMenu("Window");
|
||||
menu->AddItem(new BMenuItem("Start control panel",
|
||||
BMenu *menu = new BMenu(B_TRANSLATE("Window"));
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Start control panel"),
|
||||
new BMessage(M_START_CONTROL_PANEL),
|
||||
'P', B_COMMAND_KEY | B_SHIFT_KEY));
|
||||
menu->AddSeparatorItem();
|
||||
menu->AddItem(new BMenuItem("Close",
|
||||
menu->AddItem(new BMenuItem(B_TRANSLATE("Close"),
|
||||
new BMessage(B_QUIT_REQUESTED),
|
||||
'W', B_COMMAND_KEY));
|
||||
menuBar->AddItem(menu);
|
||||
|
||||
// future Media Theme selection capabilities go here
|
||||
menu = new BMenu("Themes");
|
||||
menu = new BMenu(B_TRANSLATE("Themes"));
|
||||
BMessage *message = new BMessage(M_THEME_SELECTED);
|
||||
BMediaTheme *theme = BMediaTheme::PreferredTheme();
|
||||
message->AddInt32("themeID", theme->ID());
|
||||
@@ -158,10 +166,11 @@ void ParameterWindow::MessageReceived(
|
||||
D_MESSAGE((" -> M_START_CONTROL_PANEL\n"));
|
||||
status_t error = _startControlPanel();
|
||||
if (error) {
|
||||
BString s = "Could not start control panel";
|
||||
s << " (" << strerror(error) << ")";
|
||||
BAlert *alert = new BAlert("", s.String(), "OK", 0, 0,
|
||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
BString s = B_TRANSLATE(
|
||||
"Could not start control panel (%error%)");
|
||||
s.ReplaceFirst("%error%", strerror(error));
|
||||
BAlert *alert = new BAlert("", s.String(), B_TRANSLATE("OK"),
|
||||
0, 0, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go(0);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,16 @@ SubDir HAIKU_TOP src apps cortex RouteApp ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) DiagramView ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) DormantNodeView ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) InfoView ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) NodeManager ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) MediaRoutingView ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) Persistence ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) Persistence Wrappers ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ParameterView ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) TipManager ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) TransportView ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ValControl ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) support ] ;
|
||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) expat xmlparse ] ;
|
||||
|
||||
SubDirCcFlags -DCORTEX_NAMESPACE=cortex ;
|
||||
|
||||
@@ -37,8 +39,15 @@ Application Cortex :
|
||||
cortex_val_control.a
|
||||
cortex_diagram_view.a
|
||||
cortex_support.a
|
||||
be media tracker translation
|
||||
be localestub media tracker translation
|
||||
[ BuildFeatureAttribute expat : library ]
|
||||
[ TargetLibstdc++ ]
|
||||
: ../Resource.rdef
|
||||
;
|
||||
|
||||
DoCatalogs Cortex :
|
||||
application/x-vnd.Cortex.Route
|
||||
:
|
||||
RouteAppNodeManager.cpp
|
||||
RouteWindow.cpp
|
||||
;
|
||||
|
||||
@@ -62,6 +62,12 @@
|
||||
|
||||
#include "set_tools.h"
|
||||
|
||||
// Locale Kit
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexRouteApp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
@@ -170,8 +176,8 @@ void RouteAppNodeManager::nodeCreated(
|
||||
|
||||
// prepare the log message
|
||||
BMessage logMsg(M_LOG);
|
||||
BString title = "Node '";
|
||||
title << ref->name() << "' created";
|
||||
BString title = B_TRANSLATE("Node '%name%' created");
|
||||
title.ReplaceFirst("%name%", ref->name());
|
||||
logMsg.AddString("title", title);
|
||||
|
||||
// create a default group for the node
|
||||
@@ -212,8 +218,8 @@ void RouteAppNodeManager::nodeDeleted(
|
||||
|
||||
// prepare the log message
|
||||
BMessage logMsg(M_LOG);
|
||||
BString title = "Node '";
|
||||
title << ref->name() << "' released";
|
||||
BString title = B_TRANSLATE("Node '%name%' released");
|
||||
title.ReplaceFirst("%name%", ref->name());
|
||||
logMsg.AddString("title", title);
|
||||
|
||||
if(ref->kind() & B_TIME_SOURCE) {
|
||||
@@ -236,11 +242,11 @@ void RouteAppNodeManager::connectionMade(
|
||||
|
||||
// prepare the log message
|
||||
BMessage logMsg(M_LOG);
|
||||
BString title = "Connection ";
|
||||
BString title = B_TRANSLATE("Connection made");
|
||||
if (strcmp(connection->outputName(), connection->inputName()) == 0) {
|
||||
title << "'" << connection->outputName() << "' ";
|
||||
title = B_TRANSLATE("Connection '%name%' made");
|
||||
title.ReplaceFirst("%name%", connection->outputName());
|
||||
}
|
||||
title << "made";
|
||||
logMsg.AddString("title", title);
|
||||
|
||||
if(!(connection->flags() & Connection::INTERNAL))
|
||||
@@ -267,22 +273,24 @@ void RouteAppNodeManager::connectionMade(
|
||||
}
|
||||
|
||||
// add node names to log messages
|
||||
BString line = "Between:";
|
||||
BString line = B_TRANSLATE("Between:");
|
||||
logMsg.AddString("line", line);
|
||||
line = " ";
|
||||
line << producer->name() << " and ";
|
||||
line << consumer->name();
|
||||
line += B_TRANSLATE("%producer% and %consumer%");
|
||||
line.ReplaceFirst("%producer%", producer->name());
|
||||
line.ReplaceFirst("%consumer%", consumer->name());
|
||||
logMsg.AddString("line", line);
|
||||
|
||||
// add format to log message
|
||||
line = "Negotiated format:";
|
||||
line = B_TRANSLATE("Negotiated format:");
|
||||
logMsg.AddString("line", line);
|
||||
line = " ";
|
||||
line << MediaString::getStringFor(connection->format(), false);
|
||||
logMsg.AddString("line", line);
|
||||
|
||||
NodeGroup *group = 0;
|
||||
BString groupName = "Untitled group ";
|
||||
BString groupName = B_TRANSLATE("Untitled group");
|
||||
groupName += " ";
|
||||
if(_canGroup(producer) && _canGroup(consumer))
|
||||
{
|
||||
if (producer->group() && consumer->group() &&
|
||||
@@ -337,11 +345,11 @@ void RouteAppNodeManager::connectionBroken(
|
||||
|
||||
// prepare the log message
|
||||
BMessage logMsg(M_LOG);
|
||||
BString title = "Connection ";
|
||||
BString title = B_TRANSLATE("Connection broken");
|
||||
if (strcmp(connection->outputName(), connection->inputName()) == 0) {
|
||||
title << "'" << connection->outputName() << "' ";
|
||||
title = B_TRANSLATE("Connection '%name%' broken");
|
||||
title.ReplaceFirst("%name%", connection->outputName());
|
||||
}
|
||||
title << "broken";
|
||||
logMsg.AddString("title", title);
|
||||
|
||||
if(!(connection->flags() & Connection::INTERNAL))
|
||||
@@ -373,11 +381,12 @@ void RouteAppNodeManager::connectionBroken(
|
||||
}
|
||||
|
||||
// add node names to log messages
|
||||
BString line = "Between:";
|
||||
BString line = B_TRANSLATE("Between:");
|
||||
logMsg.AddString("line", line);
|
||||
line = " ";
|
||||
line << producer->name() << " and ";
|
||||
line << consumer->name();
|
||||
line += B_TRANSLATE("%producer% and %consumer%");
|
||||
line.ReplaceFirst("%producer%", producer->name());
|
||||
line.ReplaceFirst("%consumer%", consumer->name());
|
||||
logMsg.AddString("line", line);
|
||||
|
||||
if(
|
||||
@@ -404,7 +413,7 @@ void RouteAppNodeManager::connectionFailed(
|
||||
|
||||
// prepare the log message
|
||||
BMessage logMsg(M_LOG);
|
||||
BString title = "Connection failed";
|
||||
BString title = B_TRANSLATE("Connection failed");
|
||||
logMsg.AddString("title", title);
|
||||
logMsg.AddInt32("error", error);
|
||||
|
||||
@@ -419,14 +428,16 @@ void RouteAppNodeManager::connectionFailed(
|
||||
}
|
||||
|
||||
// add node names to log messages
|
||||
BString line = "Between:";
|
||||
BString line = B_TRANSLATE("Between:");
|
||||
logMsg.AddString("line", line);
|
||||
line = " ";
|
||||
line << producer->name() << " and " << consumer->name();
|
||||
line += B_TRANSLATE("%producer% and %consumer%");
|
||||
line.ReplaceFirst("%producer%", producer->name());
|
||||
line.ReplaceFirst("%consumer%", consumer->name());
|
||||
logMsg.AddString("line", line);
|
||||
|
||||
// add format to log message
|
||||
line = "Tried format:";
|
||||
line = B_TRANSLATE("Tried format:");
|
||||
logMsg.AddString("line", line);
|
||||
line = " ";
|
||||
line << MediaString::getStringFor(format, true);
|
||||
|
||||
@@ -63,15 +63,21 @@
|
||||
#define D_HOOK(x) //PRINT (x)
|
||||
#define D_INTERNAL(x) //PRINT (x)
|
||||
|
||||
// Locale Kit
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexRouteApp"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
|
||||
const char* const RouteWindow::s_windowName = "Cortex";
|
||||
const char* const RouteWindow::s_windowName = B_TRANSLATE("Cortex");
|
||||
|
||||
const BRect RouteWindow::s_initFrame(100,100,700,550);
|
||||
|
||||
const char* const g_aboutText =
|
||||
"Cortex/Route 2.1.2\n\n"
|
||||
B_TRANSLATE("Cortex/Route 2.1.2\n\n"
|
||||
"Copyright 1999-2000 Eric Moon\n"
|
||||
"All rights reserved.\n\n"
|
||||
"The Cortex Team:\n\n"
|
||||
@@ -79,7 +85,7 @@ const char* const g_aboutText =
|
||||
"Eric Moon: UI, back-end\n\n"
|
||||
"Thanks to:\nJohn Ashmun\nJon Watte\nDoug Wright\n<your name here>\n\n"
|
||||
"Certain icons used herein are the property of\n"
|
||||
"Be, Inc. and are used by permission.";
|
||||
"Be, Inc. and are used by permission.");
|
||||
|
||||
|
||||
RouteWindow::~RouteWindow()
|
||||
@@ -102,21 +108,23 @@ RouteWindow::RouteWindow(RouteAppNodeManager* manager)
|
||||
|
||||
// initialize the menu bar: add all menus that target this window
|
||||
BMenuBar* pMenuBar = new BMenuBar(b, "menuBar");
|
||||
BMenu* pFileMenu = new BMenu("File");
|
||||
BMenuItem* item = new BMenuItem("Open" B_UTF8_ELLIPSIS,
|
||||
BMenu* pFileMenu = new BMenu(B_TRANSLATE("File"));
|
||||
BMenuItem* item = new BMenuItem(B_TRANSLATE("Open" B_UTF8_ELLIPSIS),
|
||||
new BMessage(RouteApp::M_SHOW_OPEN_PANEL), 'O');
|
||||
item->SetTarget(be_app);
|
||||
pFileMenu->AddItem(item);
|
||||
pFileMenu->AddItem(new BSeparatorItem());
|
||||
item = new BMenuItem("Save nodes" B_UTF8_ELLIPSIS,
|
||||
item = new BMenuItem(B_TRANSLATE("Save nodes" B_UTF8_ELLIPSIS),
|
||||
new BMessage(RouteApp::M_SHOW_SAVE_PANEL), 'S');
|
||||
item->SetTarget(be_app);
|
||||
pFileMenu->AddItem(item);
|
||||
pFileMenu->AddItem(new BSeparatorItem());
|
||||
pFileMenu->AddItem(new BMenuItem("About Cortex/Route" B_UTF8_ELLIPSIS,
|
||||
pFileMenu->AddItem(new BMenuItem(
|
||||
B_TRANSLATE("About Cortex/Route" B_UTF8_ELLIPSIS),
|
||||
new BMessage(B_ABOUT_REQUESTED)));
|
||||
pFileMenu->AddItem(new BSeparatorItem());
|
||||
pFileMenu->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED)));
|
||||
pFileMenu->AddItem(new BMenuItem(B_TRANSLATE("Quit"),
|
||||
new BMessage(B_QUIT_REQUESTED)));
|
||||
pMenuBar->AddItem(pFileMenu);
|
||||
AddChild(pMenuBar);
|
||||
|
||||
@@ -165,21 +173,21 @@ RouteWindow::RouteWindow(RouteAppNodeManager* manager)
|
||||
SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);
|
||||
|
||||
// construct the Window menu
|
||||
BMenu* windowMenu = new BMenu("Window");
|
||||
BMenu* windowMenu = new BMenu(B_TRANSLATE("Window"));
|
||||
m_transportWindowItem = new BMenuItem(
|
||||
"Show transport",
|
||||
B_TRANSLATE("Show transport"),
|
||||
new BMessage(M_TOGGLE_TRANSPORT_WINDOW));
|
||||
windowMenu->AddItem(m_transportWindowItem);
|
||||
|
||||
m_dormantNodeWindowItem = new BMenuItem(
|
||||
"Show add-ons",
|
||||
B_TRANSLATE("Show add-ons"),
|
||||
new BMessage(M_TOGGLE_DORMANT_NODE_WINDOW));
|
||||
windowMenu->AddItem(m_dormantNodeWindowItem);
|
||||
|
||||
windowMenu->AddItem(new BSeparatorItem());
|
||||
|
||||
m_pullPalettesItem = new BMenuItem(
|
||||
"Pull palettes",
|
||||
B_TRANSLATE("Pull palettes"),
|
||||
new BMessage(M_TOGGLE_PULLING_PALETTES));
|
||||
windowMenu->AddItem(m_pullPalettesItem);
|
||||
|
||||
@@ -372,7 +380,7 @@ RouteWindow::MessageReceived(BMessage* pMsg)
|
||||
switch (pMsg->what) {
|
||||
case B_ABOUT_REQUESTED:
|
||||
{
|
||||
BAlert* alert = new BAlert("About", g_aboutText, "OK");
|
||||
BAlert* alert = new BAlert("About", g_aboutText, B_TRANSLATE("OK"));
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
break;
|
||||
@@ -582,7 +590,7 @@ RouteWindow::_toggleTransportWindow()
|
||||
m_transportWindowItem->SetMarked(false);
|
||||
} else {
|
||||
m_transportWindow = new TransportWindow(m_routingView->manager,
|
||||
this, "Transport");
|
||||
this, B_TRANSLATE("Transport"));
|
||||
|
||||
// ask for a selection update
|
||||
BMessenger(m_routingView).SendMessage(
|
||||
|
||||
@@ -11,3 +11,9 @@ StaticLibrary cortex_tip_manager.a :
|
||||
TipWindow.cpp
|
||||
TipView.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_tip_manager.a :
|
||||
application/x-vnd.Cortex.TipManager
|
||||
:
|
||||
TipWindow.cpp
|
||||
;
|
||||
|
||||
@@ -35,9 +35,18 @@
|
||||
#include "TipView.h"
|
||||
|
||||
#include <Debug.h>
|
||||
// Locale Kit
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "TipWindow"
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.TipManager");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// *** dtor/ctors
|
||||
// -------------------------------------------------------- //
|
||||
@@ -145,7 +154,7 @@ void TipWindow::_createTipView() {
|
||||
if(m_text.Length())
|
||||
m_tipView->setText(m_text.String());
|
||||
else
|
||||
m_tipView->setText("(no info)");
|
||||
m_tipView->setText(B_TRANSLATE("(no info)"));
|
||||
}
|
||||
|
||||
void TipWindow::_destroyTipView() {
|
||||
|
||||
@@ -13,3 +13,9 @@ StaticLibrary cortex_transport_view.a :
|
||||
TransportView.cpp
|
||||
TransportWindow.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_transport_view.a :
|
||||
application/x-vnd.Cortex.TransportView
|
||||
:
|
||||
TransportView.cpp
|
||||
;
|
||||
|
||||
@@ -52,15 +52,26 @@
|
||||
#include <MenuItem.h>
|
||||
#include <PopUpMenu.h>
|
||||
#include <String.h>
|
||||
#include <StringFormat.h>
|
||||
#include <TextControl.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
|
||||
#undef B_CATALOG
|
||||
#define B_CATALOG (&sCatalog)
|
||||
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "TransportView"
|
||||
|
||||
using namespace std;
|
||||
|
||||
__USE_CORTEX_NAMESPACE
|
||||
|
||||
static BCatalog sCatalog("application/x-vnd.Cortex.TransportView");
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// _GroupInfoView
|
||||
// -------------------------------------------------------- //
|
||||
@@ -136,7 +147,7 @@ public: // BView
|
||||
// background +++++
|
||||
|
||||
// name
|
||||
BString name = g ? g->name() : "(no group)";
|
||||
BString name = g ? g->name() : B_TRANSLATE("(no group)");
|
||||
// +++++ constrain width
|
||||
SetFont(&m_boldFont);
|
||||
DrawString(name.String(), m_namePosition);
|
||||
@@ -144,17 +155,22 @@ public: // BView
|
||||
SetFont(&m_plainFont);
|
||||
|
||||
// node count
|
||||
BString nodeCount;
|
||||
if(g)
|
||||
nodeCount << g->countNodes();
|
||||
uint32 count;
|
||||
if (g != NULL)
|
||||
count = g->countNodes();
|
||||
else
|
||||
nodeCount << '0';
|
||||
nodeCount << ((nodeCount == "1") ? " node." : " nodes.");
|
||||
count = 0;
|
||||
|
||||
BString nodeCount = "";
|
||||
static BStringFormat format(
|
||||
B_TRANSLATE("{0, plural, one{# node} other{# nodes}}"));
|
||||
format.Format(nodeCount, count);
|
||||
|
||||
// +++++ constrain width
|
||||
DrawString(nodeCount.String(), m_nodeCountPosition);
|
||||
|
||||
// status
|
||||
BString status = "No errors.";
|
||||
BString status = B_TRANSLATE("No errors.");
|
||||
// +++++ constrain width
|
||||
DrawString(status.String(), m_statusPosition);
|
||||
}
|
||||
@@ -555,11 +571,11 @@ void TransportView::_releaseGroup() {
|
||||
// -------------------------------------------------------- //
|
||||
|
||||
const char _run_mode_strings[][20] = {
|
||||
"Offline",
|
||||
"Decrease precision",
|
||||
"Increase latency",
|
||||
"Drop data",
|
||||
"Recording"
|
||||
B_TRANSLATE_MARK("Offline"),
|
||||
B_TRANSLATE_MARK("Decrease precision"),
|
||||
B_TRANSLATE_MARK("Increase latency"),
|
||||
B_TRANSLATE_MARK("Drop data"),
|
||||
B_TRANSLATE_MARK("Recording")
|
||||
};
|
||||
const int _run_modes = 5;
|
||||
|
||||
@@ -569,8 +585,8 @@ const int _run_modes = 5;
|
||||
//};
|
||||
//const int _time_sources = 2;
|
||||
|
||||
const char* _region_start_label = "From:";
|
||||
const char* _region_end_label = "To:";
|
||||
const char* _region_start_label = B_TRANSLATE("From:");
|
||||
const char* _region_end_label = B_TRANSLATE("To:");
|
||||
|
||||
void TransportView::_constructControls() {
|
||||
|
||||
@@ -595,7 +611,7 @@ void TransportView::_constructControls() {
|
||||
m_runModeView = new BMenuField(
|
||||
BRect(),
|
||||
"runModeView",
|
||||
"Run mode:",
|
||||
B_TRANSLATE("Run mode:"),
|
||||
new BPopUpMenu("runModeMenu"));
|
||||
_populateRunModeMenu(
|
||||
m_runModeView->Menu());
|
||||
@@ -604,14 +620,14 @@ void TransportView::_constructControls() {
|
||||
m_timeSourceView = new BMenuField(
|
||||
BRect(),
|
||||
"timeSourceView",
|
||||
"Time source:",
|
||||
B_TRANSLATE("Time source:"),
|
||||
new BPopUpMenu("timeSourceMenu"));
|
||||
_populateTimeSourceMenu(
|
||||
m_timeSourceView->Menu());
|
||||
AddChild(m_timeSourceView);
|
||||
|
||||
|
||||
m_fromLabel = new BStringView(BRect(), 0, "Roll from");
|
||||
m_fromLabel = new BStringView(BRect(), 0, B_TRANSLATE("Roll from"));
|
||||
AddChild(m_fromLabel);
|
||||
|
||||
|
||||
@@ -628,7 +644,7 @@ void TransportView::_constructControls() {
|
||||
_addLocalTarget(m_regionStartView);
|
||||
AddChild(m_regionStartView);
|
||||
|
||||
m_toLabel = new BStringView(BRect(), 0, "to");
|
||||
m_toLabel = new BStringView(BRect(), 0, B_TRANSLATE("to"));
|
||||
AddChild(m_toLabel);
|
||||
|
||||
m = new BMessage(NodeGroup::M_SET_END_POSITION);
|
||||
@@ -673,7 +689,7 @@ void TransportView::_constructControls() {
|
||||
m_startButton = new BButton(
|
||||
BRect(),
|
||||
"startButton",
|
||||
"Start",
|
||||
B_TRANSLATE("Start"),
|
||||
m);
|
||||
_addGroupTarget(m_startButton);
|
||||
AddChild(m_startButton);
|
||||
@@ -682,7 +698,7 @@ void TransportView::_constructControls() {
|
||||
m_stopButton = new BButton(
|
||||
BRect(),
|
||||
"stopButton",
|
||||
"Stop",
|
||||
B_TRANSLATE("Stop"),
|
||||
m);
|
||||
_addGroupTarget(m_stopButton);
|
||||
AddChild(m_stopButton);
|
||||
@@ -691,7 +707,7 @@ void TransportView::_constructControls() {
|
||||
m_prerollButton = new BButton(
|
||||
BRect(),
|
||||
"prerollButton",
|
||||
"Preroll",
|
||||
B_TRANSLATE("Preroll"),
|
||||
m);
|
||||
_addGroupTarget(m_prerollButton);
|
||||
AddChild(m_prerollButton);
|
||||
@@ -714,7 +730,7 @@ void TransportView::_populateRunModeMenu(
|
||||
m->AddInt32("runMode", n+1);
|
||||
|
||||
BMenuItem* i = new BMenuItem(
|
||||
_run_mode_strings[n], m);
|
||||
B_TRANSLATE(_run_mode_strings[n]), m);
|
||||
menu->AddItem(i);
|
||||
_addGroupTarget(i);
|
||||
}
|
||||
@@ -737,7 +753,7 @@ void TransportView::_populateTimeSourceMenu(
|
||||
&dacTimeSource,
|
||||
sizeof(media_node));
|
||||
i = new BMenuItem(
|
||||
"DAC time source",
|
||||
B_TRANSLATE("DAC time source"),
|
||||
m);
|
||||
menu->AddItem(i);
|
||||
_addGroupTarget(i);
|
||||
@@ -752,7 +768,7 @@ void TransportView::_populateTimeSourceMenu(
|
||||
&systemTimeSource,
|
||||
sizeof(media_node));
|
||||
i = new BMenuItem(
|
||||
"System clock",
|
||||
B_TRANSLATE("System clock"),
|
||||
m);
|
||||
menu->AddItem(i);
|
||||
_addGroupTarget(i);
|
||||
@@ -851,10 +867,10 @@ void TransportView::_disableControls() {
|
||||
m_infoView->Invalidate();
|
||||
|
||||
m_runModeView->SetEnabled(false);
|
||||
m_runModeView->Menu()->Superitem()->SetLabel("(none)");
|
||||
m_runModeView->Menu()->Superitem()->SetLabel(B_TRANSLATE("(none)"));
|
||||
|
||||
m_timeSourceView->SetEnabled(false);
|
||||
m_timeSourceView->Menu()->Superitem()->SetLabel("(none)");
|
||||
m_timeSourceView->Menu()->Superitem()->SetLabel(B_TRANSLATE("(none)"));
|
||||
|
||||
m_regionStartView->SetEnabled(false);
|
||||
m_regionStartView->setValue(0);
|
||||
@@ -980,11 +996,11 @@ void TransportView::_updateTransportButtons() {
|
||||
(runMode == BMediaNode::B_OFFLINE ||
|
||||
!m_group->canCycle())) {
|
||||
|
||||
m_startButton->SetLabel("Roll");
|
||||
m_startButton->SetLabel(B_TRANSLATE("Roll"));
|
||||
m_startButton->Message()->what = NodeGroup::M_ROLL;
|
||||
|
||||
} else {
|
||||
m_startButton->SetLabel("Start");
|
||||
m_startButton->SetLabel(B_TRANSLATE("Start"));
|
||||
m_startButton->Message()->what = NodeGroup::M_START;
|
||||
}
|
||||
}
|
||||
@@ -1005,7 +1021,7 @@ void TransportView::_updateTimeSource() {
|
||||
BMenu* menu = m_timeSourceView->Menu();
|
||||
ASSERT(menu);
|
||||
if(tsNode == media_node::null) {
|
||||
menu->Superitem()->SetLabel("(none)");
|
||||
menu->Superitem()->SetLabel(B_TRANSLATE("(none)"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1049,7 +1065,7 @@ void TransportView::_updateTimeSource() {
|
||||
// }
|
||||
// }
|
||||
if(n < 0)
|
||||
menu->Superitem()->SetLabel("(???)");
|
||||
menu->Superitem()->SetLabel(B_TRANSLATE("(???)"));
|
||||
|
||||
}
|
||||
void TransportView::_updateRunMode() {
|
||||
|
||||
@@ -33,9 +33,13 @@
|
||||
|
||||
#include "AudioAdapterParams.h"
|
||||
|
||||
#include <Catalog.h>
|
||||
#include <Debug.h>
|
||||
#include <ParameterWeb.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAudioAdapter"
|
||||
|
||||
status_t
|
||||
_AudioAdapterParams::store(int32 parameterID, const void* data, size_t size)
|
||||
{
|
||||
@@ -110,18 +114,18 @@ status_t _AudioAdapterParams::retrieve(
|
||||
void _AudioAdapterParams::populateGroup(
|
||||
BParameterGroup* group) {
|
||||
|
||||
BParameterGroup* inputGroup = group->MakeGroup("Input Format");
|
||||
BParameterGroup* inputGroup = group->MakeGroup(B_TRANSLATE("Input format"));
|
||||
|
||||
BNullParameter* groupName;
|
||||
BDiscreteParameter* param;
|
||||
|
||||
groupName = inputGroup->MakeNullParameter(
|
||||
0, B_MEDIA_NO_TYPE, "Input Format", B_GENERIC);
|
||||
0, B_MEDIA_NO_TYPE, B_TRANSLATE("Input format"), B_GENERIC);
|
||||
|
||||
param = inputGroup->MakeDiscreteParameter(
|
||||
P_INPUT_FORMAT,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Sample format:",
|
||||
B_TRANSLATE("Sample format:"),
|
||||
B_GENERIC);
|
||||
param->AddItem(
|
||||
0,
|
||||
@@ -142,17 +146,17 @@ void _AudioAdapterParams::populateGroup(
|
||||
param = inputGroup->MakeDiscreteParameter(
|
||||
P_INPUT_CHANNEL_COUNT,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Channels:",
|
||||
B_TRANSLATE("Channels:"),
|
||||
B_GENERIC);
|
||||
param->AddItem(
|
||||
0,
|
||||
"*");
|
||||
param->AddItem(
|
||||
1,
|
||||
"mono");
|
||||
B_TRANSLATE("mono"));
|
||||
param->AddItem(
|
||||
2,
|
||||
"stereo");
|
||||
B_TRANSLATE("stereo"));
|
||||
param->AddItem(
|
||||
4,
|
||||
"4");
|
||||
@@ -160,15 +164,15 @@ void _AudioAdapterParams::populateGroup(
|
||||
8,
|
||||
"8");
|
||||
|
||||
BParameterGroup* outputGroup = group->MakeGroup("Output Format");
|
||||
BParameterGroup* outputGroup = group->MakeGroup(B_TRANSLATE("Output format"));
|
||||
|
||||
groupName = outputGroup->MakeNullParameter(
|
||||
0, B_MEDIA_NO_TYPE, "Output Format", B_GENERIC);
|
||||
0, B_MEDIA_NO_TYPE, B_TRANSLATE("Output format"), B_GENERIC);
|
||||
|
||||
param = outputGroup->MakeDiscreteParameter(
|
||||
P_OUTPUT_FORMAT,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Sample format:",
|
||||
B_TRANSLATE("Sample format:"),
|
||||
B_GENERIC);
|
||||
param->AddItem(
|
||||
0,
|
||||
@@ -189,17 +193,17 @@ void _AudioAdapterParams::populateGroup(
|
||||
param = outputGroup->MakeDiscreteParameter(
|
||||
P_OUTPUT_CHANNEL_COUNT,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Channels:",
|
||||
B_TRANSLATE("Channels:"),
|
||||
B_GENERIC);
|
||||
param->AddItem(
|
||||
0,
|
||||
"*");
|
||||
param->AddItem(
|
||||
1,
|
||||
"mono");
|
||||
B_TRANSLATE("mono"));
|
||||
param->AddItem(
|
||||
2,
|
||||
"stereo");
|
||||
B_TRANSLATE("stereo"));
|
||||
param->AddItem(
|
||||
4,
|
||||
"4");
|
||||
|
||||
@@ -21,5 +21,13 @@ Addon cortex_audioadapter.media_addon :
|
||||
RawBuffer.cpp
|
||||
SoundUtils.cpp
|
||||
|
||||
: be media [ TargetLibsupc++ ]
|
||||
: be media localestub [ TargetLibsupc++ ]
|
||||
;
|
||||
|
||||
DoCatalogs cortex_audioadapter.media_addon
|
||||
: application/x-vnd.moon-AudioAdapter.media_addon
|
||||
:
|
||||
AudioAdapterParams.cpp
|
||||
|
||||
../common/AudioFilterNode.cpp
|
||||
;
|
||||
|
||||
@@ -34,11 +34,15 @@
|
||||
|
||||
#include "FlangerNode.h"
|
||||
#include "FlangerAddOn.h"
|
||||
#include <Catalog.h>
|
||||
#include <Entry.h>
|
||||
#include <Debug.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsFlanger"
|
||||
|
||||
// instantiation function
|
||||
extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image);
|
||||
extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image) {
|
||||
@@ -76,10 +80,10 @@ status_t FlangerAddOn::GetFlavorAt(
|
||||
|
||||
flavor_info* pInfo = new flavor_info;
|
||||
pInfo->internal_id = n;
|
||||
pInfo->name = (char *)"Flanger";
|
||||
pInfo->name = (char *)B_TRANSLATE("Flanger");
|
||||
pInfo->info = (char *)
|
||||
"An add-on version of FlangerNode.\n"
|
||||
"by Eric Moon (16 June, 1999)";
|
||||
B_TRANSLATE("An add-on version of FlangerNode.\n"
|
||||
"by Eric Moon (16 June, 1999)");
|
||||
pInfo->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE;
|
||||
pInfo->flavor_flags = 0;
|
||||
pInfo->possible_count = 0;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <Buffer.h>
|
||||
#include <BufferGroup.h>
|
||||
#include <ByteOrder.h>
|
||||
#include <Catalog.h>
|
||||
#include <Debug.h>
|
||||
#include <ParameterWeb.h>
|
||||
#include <TimeSource.h>
|
||||
@@ -49,6 +50,9 @@
|
||||
#include <cstring>
|
||||
#include <cmath>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsFlanger"
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// local helpers
|
||||
// -------------------------------------------------------- //
|
||||
@@ -241,7 +245,7 @@ void FlangerNode::NodeRegistered() {
|
||||
m_input.node = Node();
|
||||
m_input.source = media_source::null;
|
||||
m_input.format = m_format;
|
||||
strncpy(m_input.name, "Audio Input", B_MEDIA_NAME_LENGTH);
|
||||
strlcpy(m_input.name, B_TRANSLATE("Audio input"), B_MEDIA_NAME_LENGTH);
|
||||
|
||||
// init output
|
||||
m_output.source.port = ControlPort();
|
||||
@@ -249,7 +253,7 @@ void FlangerNode::NodeRegistered() {
|
||||
m_output.node = Node();
|
||||
m_output.destination = media_destination::null;
|
||||
m_output.format = m_format;
|
||||
strncpy(m_output.name, "Mix Output", B_MEDIA_NAME_LENGTH);
|
||||
strlcpy(m_output.name, B_TRANSLATE("Mix output"), B_MEDIA_NAME_LENGTH);
|
||||
|
||||
// init parameters
|
||||
initParameterValues();
|
||||
@@ -1251,18 +1255,19 @@ void FlangerNode::initParameterValues() {
|
||||
// create and register a parameter web
|
||||
void FlangerNode::initParameterWeb() {
|
||||
BParameterWeb* pWeb = new BParameterWeb();
|
||||
BParameterGroup* pTopGroup = pWeb->MakeGroup("FlangerNode Parameters");
|
||||
BParameterGroup* pTopGroup = pWeb->MakeGroup(
|
||||
B_TRANSLATE("FlangerNode parameters"));
|
||||
|
||||
BNullParameter* label;
|
||||
BContinuousParameter* value;
|
||||
BParameterGroup* g;
|
||||
|
||||
// mix ratio
|
||||
g = pTopGroup->MakeGroup("Mix ratio");
|
||||
g = pTopGroup->MakeGroup(B_TRANSLATE("Mix ratio"));
|
||||
label = g->MakeNullParameter(
|
||||
P_MIX_RATIO_LABEL,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Mix ratio",
|
||||
B_TRANSLATE("Mix ratio"),
|
||||
B_GENERIC);
|
||||
|
||||
value = g->MakeContinuousParameter(
|
||||
@@ -1274,11 +1279,11 @@ void FlangerNode::initParameterWeb() {
|
||||
value->AddInput(label);
|
||||
|
||||
// sweep rate
|
||||
g = pTopGroup->MakeGroup("Sweep rate");
|
||||
g = pTopGroup->MakeGroup(B_TRANSLATE("Sweep rate"));
|
||||
label = g->MakeNullParameter(
|
||||
P_SWEEP_RATE_LABEL,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Sweep rate",
|
||||
B_TRANSLATE("Sweep rate"),
|
||||
B_GENERIC);
|
||||
|
||||
value = g->MakeContinuousParameter(
|
||||
@@ -1290,11 +1295,11 @@ void FlangerNode::initParameterWeb() {
|
||||
value->AddInput(label);
|
||||
|
||||
// sweep range: minimum delay
|
||||
g = pTopGroup->MakeGroup("Delay");
|
||||
g = pTopGroup->MakeGroup(B_TRANSLATE("Delay"));
|
||||
label = g->MakeNullParameter(
|
||||
P_DELAY_LABEL,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Delay",
|
||||
B_TRANSLATE("Delay"),
|
||||
B_GENERIC);
|
||||
|
||||
value = g->MakeContinuousParameter(
|
||||
@@ -1306,11 +1311,11 @@ void FlangerNode::initParameterWeb() {
|
||||
value->AddInput(label);
|
||||
|
||||
// sweep range: maximum
|
||||
g = pTopGroup->MakeGroup("Depth");
|
||||
g = pTopGroup->MakeGroup(B_TRANSLATE("Depth"));
|
||||
label = g->MakeNullParameter(
|
||||
P_DEPTH_LABEL,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Depth",
|
||||
B_TRANSLATE("Depth"),
|
||||
B_GENERIC);
|
||||
|
||||
value = g->MakeContinuousParameter(
|
||||
@@ -1322,11 +1327,11 @@ void FlangerNode::initParameterWeb() {
|
||||
value->AddInput(label);
|
||||
|
||||
// feedback
|
||||
g = pTopGroup->MakeGroup("Feedback");
|
||||
g = pTopGroup->MakeGroup(B_TRANSLATE("Feedback"));
|
||||
label = g->MakeNullParameter(
|
||||
P_FEEDBACK_LABEL,
|
||||
B_MEDIA_NO_TYPE,
|
||||
"Feedback",
|
||||
B_TRANSLATE("Feedback"),
|
||||
B_GENERIC);
|
||||
|
||||
value = g->MakeContinuousParameter(
|
||||
|
||||
@@ -13,5 +13,14 @@ Addon cortex_flanger.media_addon :
|
||||
MediaNodeControlApp.cpp
|
||||
RawBuffer.cpp
|
||||
SoundUtils.cpp
|
||||
: be media [ TargetLibsupc++ ]
|
||||
: be media localestub [ TargetLibsupc++ ]
|
||||
;
|
||||
|
||||
DoCatalogs cortex_flanger.media_addon
|
||||
: application/x-vnd.moon-Flanger.media_addon
|
||||
:
|
||||
FlangerAddOn.cpp
|
||||
FlangerNode.cpp
|
||||
|
||||
../common/MediaNodeControlApp.cpp
|
||||
;
|
||||
|
||||
@@ -14,5 +14,16 @@ Addon cortex_logging_consumer.media_addon :
|
||||
# common/
|
||||
MediaNodeControlApp.cpp
|
||||
|
||||
: be media [ TargetLibstdc++ ]
|
||||
: be media localestub [ TargetLibstdc++ ]
|
||||
;
|
||||
|
||||
DoCatalogs cortex_logging_consumer.media_addon
|
||||
: application/x-vnd.Be.LoggingConsumerApp
|
||||
:
|
||||
LoggingConsumer.cpp
|
||||
LoggingConsumerAddOn.cpp
|
||||
NodeHarnessApp.cpp
|
||||
NodeHarnessWin.cpp
|
||||
|
||||
../common/MediaNodeControlApp.cpp
|
||||
;
|
||||
|
||||
@@ -43,8 +43,12 @@
|
||||
#include <string.h>
|
||||
|
||||
// e.moon [11jun99]
|
||||
#include <Catalog.h>
|
||||
#include <Debug.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsLoggingConsumer"
|
||||
|
||||
// id's of the node's BParameters
|
||||
const int32 INPUT_NULL_PARAM = 1;
|
||||
const int32 LATENCY_PARAM = 2;
|
||||
@@ -59,24 +63,31 @@ static BParameterWeb* build_parameter_web()
|
||||
{
|
||||
BParameterWeb* web = new BParameterWeb;
|
||||
|
||||
BParameterGroup* mainGroup = web->MakeGroup("LoggingConsumer Parameters");
|
||||
BParameterGroup* group = mainGroup->MakeGroup("Latency control");
|
||||
BParameter* nullParam = group->MakeNullParameter(INPUT_NULL_PARAM, B_MEDIA_NO_TYPE, "Latency", B_GENERIC);
|
||||
BParameter* latencyParam = group->MakeContinuousParameter(LATENCY_PARAM, B_MEDIA_NO_TYPE, "",
|
||||
B_GAIN, "ms", 5, 100, 5);
|
||||
BParameterGroup* mainGroup = web->MakeGroup(
|
||||
B_TRANSLATE("LoggingConsumer parameters"));
|
||||
BParameterGroup* group = mainGroup->MakeGroup(
|
||||
B_TRANSLATE("Latency control"));
|
||||
BParameter* nullParam = group->MakeNullParameter(INPUT_NULL_PARAM,
|
||||
B_MEDIA_NO_TYPE, B_TRANSLATE("Latency"), B_GENERIC);
|
||||
BParameter* latencyParam = group->MakeContinuousParameter(LATENCY_PARAM,
|
||||
B_MEDIA_NO_TYPE, "", B_GAIN, "ms", 5, 100, 5);
|
||||
nullParam->AddOutput(latencyParam);
|
||||
latencyParam->AddInput(nullParam);
|
||||
|
||||
group = mainGroup->MakeGroup("CPU percentage");
|
||||
nullParam = group->MakeNullParameter(CPU_NULL_PARAM, B_MEDIA_NO_TYPE, "CPU spin percentage", B_GENERIC);
|
||||
BContinuousParameter* cpuParam = group->MakeContinuousParameter(CPU_SPIN_PARAM, B_MEDIA_NO_TYPE, "",
|
||||
B_GAIN, "percent", 5, 80, 5);
|
||||
group = mainGroup->MakeGroup(B_TRANSLATE("CPU percentage"));
|
||||
nullParam = group->MakeNullParameter(CPU_NULL_PARAM, B_MEDIA_NO_TYPE,
|
||||
B_TRANSLATE("CPU spin percentage"), B_GENERIC);
|
||||
BContinuousParameter* cpuParam = group->MakeContinuousParameter(
|
||||
CPU_SPIN_PARAM, B_MEDIA_NO_TYPE, "",
|
||||
B_GAIN, B_TRANSLATE("percent"), 5, 80, 5);
|
||||
nullParam->AddOutput(cpuParam);
|
||||
cpuParam->AddInput(nullParam);
|
||||
|
||||
group = mainGroup->MakeGroup("Priority");
|
||||
nullParam = group->MakeNullParameter(PRIO_NULL_PARAM, B_MEDIA_NO_TYPE, "Thread priority", B_GENERIC);
|
||||
BDiscreteParameter* prioParam = group->MakeDiscreteParameter(PRIORITY_PARAM, B_MEDIA_NO_TYPE, "", B_GENERIC);
|
||||
group = mainGroup->MakeGroup(B_TRANSLATE("Priority"));
|
||||
nullParam = group->MakeNullParameter(PRIO_NULL_PARAM, B_MEDIA_NO_TYPE,
|
||||
B_TRANSLATE("Thread priority"), B_GENERIC);
|
||||
BDiscreteParameter* prioParam = group->MakeDiscreteParameter(PRIORITY_PARAM,
|
||||
B_MEDIA_NO_TYPE, "", B_GENERIC);
|
||||
prioParam->AddItem(5, "B_LOW_PRIORITY");
|
||||
prioParam->AddItem(10, "B_NORMAL_PRIORITY");
|
||||
prioParam->AddItem(15, "B_DISPLAY_PRIORITY");
|
||||
@@ -521,7 +532,7 @@ LoggingConsumer::NodeRegistered()
|
||||
mInput.destination.port = ControlPort();
|
||||
mInput.destination.id = 0;
|
||||
mInput.node = Node();
|
||||
strcpy(mInput.name, "Logged input");
|
||||
strcpy(mInput.name, B_TRANSLATE("Logged input"));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "LoggingConsumer.h"
|
||||
#include "LoggingConsumerAddOn.h"
|
||||
#include <Entry.h>
|
||||
#include <Catalog.h>
|
||||
#include <Debug.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
@@ -44,6 +45,10 @@
|
||||
const char* const g_pLogPath = "/tmp/node_log";
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsLoggingConsumer"
|
||||
|
||||
|
||||
// instantiation function
|
||||
extern "C" _EXPORT BMediaAddOn* make_media_addon(image_id image) {
|
||||
return new LoggingConsumerAddOn(image);
|
||||
@@ -80,10 +85,11 @@ status_t LoggingConsumerAddOn::GetFlavorAt(
|
||||
|
||||
flavor_info* pInfo = new flavor_info;
|
||||
pInfo->internal_id = n;
|
||||
pInfo->name = (char*)"LoggingConsumer";
|
||||
pInfo->info = (char*)"An add-on version of the LoggingConsumer node.\n"
|
||||
pInfo->name = (char*)B_TRANSLATE("LoggingConsumer");
|
||||
pInfo->info = (char*)B_TRANSLATE(
|
||||
"An add-on version of the LoggingConsumer node.\n"
|
||||
"See the Be Developer Newsletter III.18: 5 May, 1999\n"
|
||||
"adapted by Eric Moon (4 June, 1999)";
|
||||
"adapted by Eric Moon (4 June, 1999)");
|
||||
pInfo->kinds = B_BUFFER_CONSUMER | B_CONTROLLABLE;
|
||||
pInfo->flavor_flags = 0;
|
||||
pInfo->possible_count = 0;
|
||||
|
||||
@@ -35,6 +35,11 @@
|
||||
#include "NodeHarnessApp.h"
|
||||
#include "NodeHarnessWin.h"
|
||||
|
||||
#include <Catalog.h>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsLoggingConsumers"
|
||||
|
||||
NodeHarnessApp::NodeHarnessApp(const char *signature)
|
||||
: BApplication(signature)
|
||||
{
|
||||
@@ -43,6 +48,7 @@ NodeHarnessApp::NodeHarnessApp(const char *signature)
|
||||
void
|
||||
NodeHarnessApp::ReadyToRun()
|
||||
{
|
||||
BWindow* win = new NodeHarnessWin(BRect(100, 200, 210, 330), "NodeLogger");
|
||||
BWindow* win = new NodeHarnessWin(BRect(100, 200, 210, 330),
|
||||
B_TRANSLATE("NodeLogger"));
|
||||
win->Show();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <app/Application.h>
|
||||
#include <interface/Button.h>
|
||||
//#include <storage/Entry.h>
|
||||
#include <Catalog.h>
|
||||
#include <Entry.h>
|
||||
#include <media/MediaRoster.h>
|
||||
#include <media/MediaAddOn.h>
|
||||
@@ -45,6 +46,11 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsLoggingConsumerNodeHarnessWin"
|
||||
|
||||
|
||||
const int32 BUTTON_CONNECT = 'Cnct';
|
||||
const int32 BUTTON_START = 'Strt';
|
||||
const int32 BUTTON_STOP = 'Stop';
|
||||
@@ -70,15 +76,18 @@ NodeHarnessWin::NodeHarnessWin(BRect frame, const char *title)
|
||||
{
|
||||
// build the UI
|
||||
BRect r(10, 10, 100, 40);
|
||||
mConnectButton = new BButton(r, "Connect", "Connect", new BMessage(BUTTON_CONNECT));
|
||||
mConnectButton = new BButton(r, "Connect", B_TRANSLATE("Connect"),
|
||||
new BMessage(BUTTON_CONNECT));
|
||||
mConnectButton->SetEnabled(true);
|
||||
AddChild(mConnectButton);
|
||||
r.OffsetBy(0, 40);
|
||||
mStartButton = new BButton(r, "Start", "Start", new BMessage(BUTTON_START));
|
||||
mStartButton = new BButton(r, "Start", B_TRANSLATE("Start"),
|
||||
new BMessage(BUTTON_START));
|
||||
mStartButton->SetEnabled(false);
|
||||
AddChild(mStartButton);
|
||||
r.OffsetBy(0, 40);
|
||||
mStopButton = new BButton(r, "Stop", "Stop", new BMessage(BUTTON_STOP));
|
||||
mStopButton = new BButton(r, "Stop", B_TRANSLATE("Stop"),
|
||||
new BMessage(BUTTON_STOP));
|
||||
mStopButton->SetEnabled(false);
|
||||
AddChild(mStopButton);
|
||||
}
|
||||
@@ -160,8 +169,9 @@ NodeHarnessWin::MessageReceived(BMessage *msg)
|
||||
BParameterWeb* web;
|
||||
r->GetParameterWebFor(mConnection.consumer, &web);
|
||||
BView* view = BMediaTheme::ViewFor(web);
|
||||
BWindow* win = new BWindow(BRect(250, 200, 300, 300), "Controls",
|
||||
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS);
|
||||
BWindow* win = new BWindow(BRect(250, 200, 300, 300),
|
||||
B_TRANSLATE("Controls"), B_TITLED_WINDOW,
|
||||
B_ASYNCHRONOUS_CONTROLS);
|
||||
win->AddChild(view);
|
||||
win->ResizeTo(view->Bounds().Width(), view->Bounds().Height());
|
||||
win->Show();
|
||||
|
||||
@@ -38,9 +38,13 @@
|
||||
|
||||
#include <Entry.h>
|
||||
#include <Debug.h>
|
||||
#include <Catalog.h>
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsNullFilter"
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// _NullFilterNode
|
||||
// -------------------------------------------------------- //
|
||||
@@ -119,10 +123,10 @@ status_t NullFilterAddOn::GetFlavorAt(
|
||||
|
||||
flavor_info* pInfo = new flavor_info;
|
||||
pInfo->internal_id = n;
|
||||
pInfo->name = "NullFilter";
|
||||
pInfo->name = B_TRANSLATE("NullFilter");
|
||||
pInfo->info =
|
||||
"NullFilter (empty test filter).\n"
|
||||
"by Eric Moon (8 September 1999)";
|
||||
B_TRANSLATE("NullFilter (empty test filter).\n"
|
||||
"by Eric Moon (8 September 1999)");
|
||||
pInfo->kinds = B_BUFFER_CONSUMER | B_BUFFER_PRODUCER | B_CONTROLLABLE;
|
||||
pInfo->flavor_flags = 0;
|
||||
pInfo->possible_count = 0;
|
||||
@@ -163,4 +167,4 @@ status_t NullFilterAddOn::GetConfigurationFor(
|
||||
}
|
||||
|
||||
|
||||
// END -- NullFilterAddOn.cpp --
|
||||
// END -- NullFilterAddOn.cpp --
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <Buffer.h>
|
||||
#include <BufferGroup.h>
|
||||
#include <ByteOrder.h>
|
||||
#include <Catalog.h>
|
||||
#include <ParameterWeb.h>
|
||||
#include <String.h>
|
||||
#include <TimeSource.h>
|
||||
@@ -52,6 +53,9 @@
|
||||
#include <cstring>
|
||||
//#include <cmath>
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsCommon"
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// constants
|
||||
// -------------------------------------------------------- //
|
||||
@@ -394,7 +398,7 @@ void AudioFilterNode::NodeRegistered() {
|
||||
err = getRequiredInputFormat(m_input.format);
|
||||
ASSERT(err == B_OK);
|
||||
|
||||
strncpy(m_input.name, "Audio Input", B_MEDIA_NAME_LENGTH);
|
||||
strlcpy(m_input.name, B_TRANSLATE("Audio input"), B_MEDIA_NAME_LENGTH);
|
||||
|
||||
// init output
|
||||
m_output.source.port = ControlPort();
|
||||
@@ -406,7 +410,7 @@ void AudioFilterNode::NodeRegistered() {
|
||||
err = getRequiredOutputFormat(m_output.format);
|
||||
ASSERT(err == B_OK);
|
||||
|
||||
strncpy(m_output.name, "Audio Output", B_MEDIA_NAME_LENGTH);
|
||||
strlcpy(m_output.name, B_TRANSLATE("Audio output"), B_MEDIA_NAME_LENGTH);
|
||||
|
||||
// init parameters
|
||||
initParameterWeb();
|
||||
@@ -1324,8 +1328,8 @@ void AudioFilterNode::initParameterWeb() {
|
||||
ASSERT(m_parameterSet);
|
||||
|
||||
BParameterWeb* web = new BParameterWeb();
|
||||
BString groupName = Name();
|
||||
groupName << " Parameters";
|
||||
BString groupName = B_TRANSLATE("%groupname% parameters");
|
||||
groupName.ReplaceFirst("%groupname%", Name());
|
||||
BParameterGroup* group = web->MakeGroup(groupName.String());
|
||||
m_parameterSet->populateGroup(group);
|
||||
|
||||
|
||||
@@ -40,11 +40,17 @@
|
||||
#include <ParameterWeb.h>
|
||||
#include <String.h>
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "CortexAddOnsCommonMediaNodeControlApp"
|
||||
|
||||
|
||||
// -------------------------------------------------------- //
|
||||
// ctor/dtor
|
||||
// -------------------------------------------------------- //
|
||||
@@ -82,9 +88,10 @@ MediaNodeControlApp::MediaNodeControlApp(
|
||||
if(err < B_OK) {
|
||||
char buffer[512];
|
||||
sprintf(buffer,
|
||||
"MediaNodeControlApp: couldn't find node (%" B_PRId32 "):\n%s\n",
|
||||
B_TRANSLATE("MediaNodeControlApp: couldn't find node (%"
|
||||
B_PRId32 "):\n%s\n"),
|
||||
nodeID, strerror(err));
|
||||
BAlert* alert = new BAlert("error", buffer, "OK");
|
||||
BAlert* alert = new BAlert("error", buffer, B_TRANSLATE("OK"));
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
return;
|
||||
@@ -96,16 +103,17 @@ MediaNodeControlApp::MediaNodeControlApp(
|
||||
if(err < B_OK) {
|
||||
char buffer[512];
|
||||
sprintf(buffer,
|
||||
"MediaNodeControlApp: couldn't get node info (%" B_PRId32
|
||||
"):\n%s\n", nodeID, strerror(err));
|
||||
BAlert* alert = new BAlert("error", buffer, "OK");
|
||||
B_TRANSLATE("MediaNodeControlApp: couldn't get node info (%"
|
||||
B_PRId32 "):\n%s\n"), nodeID, strerror(err));
|
||||
BAlert* alert = new BAlert("error", buffer, B_TRANSLATE("OK"));
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
return;
|
||||
}
|
||||
|
||||
BString windowTitle;
|
||||
windowTitle << nInfo.name << '(' << nodeID << ") controls";
|
||||
windowTitle << nInfo.name << '(' << nodeID << ") "
|
||||
<< B_TRANSLATE("controls");
|
||||
|
||||
// get parameter web
|
||||
BParameterWeb* pWeb;
|
||||
@@ -113,9 +121,9 @@ MediaNodeControlApp::MediaNodeControlApp(
|
||||
if(err < B_OK) {
|
||||
char buffer[512];
|
||||
sprintf(buffer,
|
||||
"MediaNodeControlApp: no parameters for node (%" B_PRId32
|
||||
"):\n%s\n", nodeID, strerror(err));
|
||||
BAlert* alert = new BAlert("error", buffer, "OK");
|
||||
B_TRANSLATE("MediaNodeControlApp: no parameters for node (%"
|
||||
B_PRId32 "):\n%s\n"), nodeID, strerror(err));
|
||||
BAlert* alert = new BAlert("error", buffer, B_TRANSLATE("OK"));
|
||||
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
|
||||
alert->Go();
|
||||
return;
|
||||
|
||||
@@ -15,3 +15,9 @@ StaticLibrary cortex_support.a :
|
||||
SoundUtils.cpp
|
||||
TextControlFloater.cpp
|
||||
;
|
||||
|
||||
DoCatalogs cortex_support.a :
|
||||
application/x-vnd.Cortex.support
|
||||
:
|
||||
MediaString.cpp
|
||||
;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user