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