Localized MEdia preflet and translated it to french.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33799 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
1 english x-vnd.Haiku-Media 1721947718
|
||||||
|
Show Volume Control on Deskbar Media views Afficher le contrôle de volume dans la Deskbar
|
||||||
|
Audio Input: Media views Audio Input:
|
||||||
|
Restarting Media Services\nStarting Media Server…\n Media Window Redémarrage des services media\nDémarrage du serveur media…\n
|
||||||
|
Video Input: Media views Entrée vidéo:
|
||||||
|
Waiting for media_server to quit. Media Window Attente de la fin du serveur media.
|
||||||
|
Defaults Media views Défauts
|
||||||
|
Stopping Media Server… Media Window Arrêt du serveur media…
|
||||||
|
Video Output: Media views Sortie vidéo:
|
||||||
|
Enable Real-Time Audio Media views Activer l'audio temps réel
|
||||||
|
Quit Media Window Quitter
|
||||||
|
OK Media Window Ok
|
||||||
|
Enabling Real-Time Video allows system to perform video operations as fast and smoothly as possible. It achieves optimum performance by using more RAM.\n\nOnly enable this feature if you need the lowest latency possible. Media views Activer la vidéo temps réel permet au système d'effectuer les opérations vidéo aussi rapidement et fluidement que possible. Ceci est fait en utilisant plus de mémoire.\n\nN'activez cette option que si vous avez besoin de la latence la plus faible possible.
|
||||||
|
Default Nodes Media views Noeuds par défaut
|
||||||
|
Starting Media Server… Media Window Démarrage du serveur média…
|
||||||
|
Restart the Media Server to apply changes. Media views Redémarrez le serveur media pour appliquer les changements.
|
||||||
|
Done Shutting Down. Media Window Arrêt terminé.
|
||||||
|
Cleaning Up. Media Window Nettoyage.
|
||||||
|
Telling media_addon_server to quit. Media Window Demande au serveur add-on media de quitter.
|
||||||
|
Enable Real-Time Video Media views Activer la vidéo temps réel
|
||||||
|
This hardware has no controls. Media Window Ce matériel n'a pas de contrôles.
|
||||||
|
Restarting Media Services\nShutting down Media Server\n Media Window Redémarrage des services média\nArrêt du serveur média\n
|
||||||
|
Audio Output: Media views Sortie audio:
|
||||||
|
Start Media Server Media Window Démarrer le serveur media
|
||||||
|
Audio Settings Media Window Réglages audio
|
||||||
|
Could not connect to the Media Server.\nWould you like to start it ? Media Window Impossible de se connecter au serveur media.\nVoulez-vous le démarrer ?
|
||||||
|
Ready For Use… Media Window Prêt à servir…
|
||||||
|
Real-Time Media views Tems réel
|
||||||
|
Restart Media Services Media views Redémarrer les services media
|
||||||
|
Enabling Real-time Audio allows system to record and play audio as fast as possible. It achieves this performance by using more CPU and RAM.\n\nOnly enable this feature if you need the lowest latency possible. Media views Activer le son temps réel permet au système d'enregistrer et lire le son aussi rapidement que possible. Ceci utilise plus de mémoire et de temps processeur.\n\nN'activez cette option que si vous avez besoin de la latence la plus faible possible.
|
||||||
|
Couldn't remove Volume control in Deskbar: %s\n Media Window Impossible d'enlever le contrôle du volume de la Deskbar : %s\n
|
||||||
|
Couldn't add Volume control in Deskbar: %s\n Media Window Impossible d'ajouter le contrôle du volume dans la Deskbar: %s\n
|
||||||
|
Media Media Window Media
|
||||||
|
Channel: Media views Canal :
|
||||||
@@ -15,7 +15,14 @@ Preference Media :
|
|||||||
MediaViews.cpp
|
MediaViews.cpp
|
||||||
MediaListItem.cpp
|
MediaListItem.cpp
|
||||||
MediaAlert.cpp
|
MediaAlert.cpp
|
||||||
: media be $(TARGET_LIBSUPC++)
|
: media be liblocale.so $(TARGET_LIBSUPC++)
|
||||||
: media.rdef
|
: media.rdef
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs Media
|
||||||
|
: x-vnd.Haiku-Media
|
||||||
|
: MediaViews.cpp
|
||||||
|
MediaWindow.cpp
|
||||||
|
: en.catalog
|
||||||
|
: fr.catkeys
|
||||||
|
;
|
||||||
|
|||||||
@@ -10,17 +10,22 @@
|
|||||||
|
|
||||||
#include "Media.h"
|
#include "Media.h"
|
||||||
|
|
||||||
#include <StorageKit.h>
|
|
||||||
#include <Roster.h>
|
|
||||||
#include <String.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
|
#include <Roster.h>
|
||||||
|
#include <StorageKit.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
|
|
||||||
Media::Media()
|
Media::Media()
|
||||||
: BApplication("application/x-vnd.Haiku-Media")
|
: BApplication("application/x-vnd.Haiku-Media")
|
||||||
{
|
{
|
||||||
BRect rect(32,64,637,462);
|
BRect rect(32,64,637,462);
|
||||||
|
|
||||||
|
be_locale->GetAppCatalog(&fCatalog);
|
||||||
|
|
||||||
BPath path;
|
BPath path;
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK) {
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK) {
|
||||||
path.Append(SETTINGS_FILE);
|
path.Append(SETTINGS_FILE);
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
#include "MediaWindow.h"
|
#include "MediaWindow.h"
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Locale.h>
|
||||||
|
|
||||||
|
|
||||||
class Media : public BApplication {
|
class Media : public BApplication {
|
||||||
@@ -25,6 +27,7 @@ class Media : public BApplication {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MediaWindow* fWindow;
|
MediaWindow* fWindow;
|
||||||
|
BCatalog fCatalog;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MEDIA_H
|
#endif // MEDIA_H
|
||||||
|
|||||||
@@ -15,22 +15,27 @@
|
|||||||
|
|
||||||
|
|
||||||
// Includes -------------------------------------------------------------------------------------------------- //
|
// Includes -------------------------------------------------------------------------------------------------- //
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <MenuField.h>
|
#include <Catalog.h>
|
||||||
#include <PopUpMenu.h>
|
|
||||||
#include <MediaRoster.h>
|
|
||||||
#include <Deskbar.h>
|
#include <Deskbar.h>
|
||||||
#include <Entry.h>
|
#include <Entry.h>
|
||||||
#include <stdio.h>
|
#include <GroupView.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MediaAddOn.h>
|
#include <MediaAddOn.h>
|
||||||
|
#include <MediaRoster.h>
|
||||||
|
#include <MenuField.h>
|
||||||
|
#include <PopUpMenu.h>
|
||||||
|
#include <SpaceLayoutItem.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <TextView.h>
|
#include <TextView.h>
|
||||||
#include <GroupView.h>
|
|
||||||
#include <SpaceLayoutItem.h>
|
|
||||||
|
|
||||||
#include "MediaViews.h"
|
#include "MediaViews.h"
|
||||||
|
|
||||||
|
#define TR_CONTEXT "Media views"
|
||||||
|
|
||||||
BarView::BarView()
|
BarView::BarView()
|
||||||
: BView ("barView", B_WILL_DRAW ),
|
: BView ("barView", B_WILL_DRAW ),
|
||||||
fDisplay(true)
|
fDisplay(true)
|
||||||
@@ -63,7 +68,7 @@ SettingsView::SettingsView (bool isVideo)
|
|||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
BBox *defaultsBox = new BBox("defaults");
|
BBox *defaultsBox = new BBox("defaults");
|
||||||
defaultsBox->SetLabel(fIsVideo ? "Default Nodes" : "Defaults");
|
defaultsBox->SetLabel(fIsVideo ? TR("Default Nodes") : TR("Defaults"));
|
||||||
|
|
||||||
// create the default box
|
// create the default box
|
||||||
BGroupLayout* defaultBoxLayout = new BGroupLayout(B_VERTICAL, 5);
|
BGroupLayout* defaultBoxLayout = new BGroupLayout(B_VERTICAL, 5);
|
||||||
@@ -76,17 +81,18 @@ SettingsView::SettingsView (bool isVideo)
|
|||||||
defaultsBox->GetLayout()->AddView(inputField);
|
defaultsBox->GetLayout()->AddView(inputField);
|
||||||
defaultsBox->GetLayout()->AddView(outputField);
|
defaultsBox->GetLayout()->AddView(outputField);
|
||||||
|
|
||||||
float divider = StringWidth(fIsVideo ? "Video Output:" : "Audio Output:") + 5;
|
float divider = StringWidth(fIsVideo ? TR("Video Output:")
|
||||||
|
: TR("Audio Output:")) + 5;
|
||||||
fMenu1 = new BPopUpMenu("<none>");
|
fMenu1 = new BPopUpMenu("<none>");
|
||||||
fMenu1->SetLabelFromMarked(true);
|
fMenu1->SetLabelFromMarked(true);
|
||||||
BMenuField *menuField1 = new BMenuField("menuField1",
|
BMenuField *menuField1 = new BMenuField("menuField1",
|
||||||
fIsVideo ? "Video Input:" : "Audio Input:", fMenu1, NULL);
|
fIsVideo ? TR("Video Input:") : TR("Audio Input:"), fMenu1, NULL);
|
||||||
menuField1->SetDivider(divider);
|
menuField1->SetDivider(divider);
|
||||||
|
|
||||||
fMenu2 = new BPopUpMenu("<none>");
|
fMenu2 = new BPopUpMenu("<none>");
|
||||||
fMenu2->SetLabelFromMarked(true);
|
fMenu2->SetLabelFromMarked(true);
|
||||||
BMenuField *menuField2 = new BMenuField("menuField2",
|
BMenuField *menuField2 = new BMenuField("menuField2",
|
||||||
fIsVideo ? "Video Output:" : "Audio Output:", fMenu2, NULL);
|
fIsVideo ? TR("Video Output:") : TR("Audio Output:"), fMenu2, NULL);
|
||||||
menuField2->SetDivider(divider);
|
menuField2->SetDivider(divider);
|
||||||
|
|
||||||
inputField->GroupLayout()->AddView(menuField1);
|
inputField->GroupLayout()->AddView(menuField1);
|
||||||
@@ -97,26 +103,26 @@ SettingsView::SettingsView (bool isVideo)
|
|||||||
fMenu3 = new BPopUpMenu("<none>");
|
fMenu3 = new BPopUpMenu("<none>");
|
||||||
fMenu3->SetLabelFromMarked(true);
|
fMenu3->SetLabelFromMarked(true);
|
||||||
menuField3 = new BMenuField("menuField3",
|
menuField3 = new BMenuField("menuField3",
|
||||||
"Channel:", fMenu3, NULL);
|
TR("Channel:"), fMenu3, NULL);
|
||||||
outputField->GroupLayout()->AddView(menuField3);
|
outputField->GroupLayout()->AddView(menuField3);
|
||||||
menuField3->SetDivider(StringWidth("Channel:")+5);
|
menuField3->SetDivider(StringWidth(TR("Channel:"))+5);
|
||||||
}
|
}
|
||||||
|
|
||||||
rgb_color red_color = {222, 32, 33};
|
rgb_color red_color = {222, 32, 33};
|
||||||
fRestartView = new BStringView("restartStringView",
|
fRestartView = new BStringView("restartStringView",
|
||||||
"Restart the Media Server to apply changes.");
|
TR("Restart the Media Server to apply changes."));
|
||||||
fRestartView->SetHighColor(red_color);
|
fRestartView->SetHighColor(red_color);
|
||||||
defaultsBox->AddChild(fRestartView);
|
defaultsBox->AddChild(fRestartView);
|
||||||
fRestartView->Hide();
|
fRestartView->Hide();
|
||||||
|
|
||||||
// create the realtime box
|
// create the realtime box
|
||||||
BBox *realtimeBox = new BBox("realtime");
|
BBox *realtimeBox = new BBox("realtime");
|
||||||
realtimeBox->SetLabel("Real-Time");
|
realtimeBox->SetLabel(TR("Real-Time"));
|
||||||
|
|
||||||
BMessage *message = new BMessage(ML_ENABLE_REAL_TIME);
|
BMessage *message = new BMessage(ML_ENABLE_REAL_TIME);
|
||||||
message->AddBool("isVideo", fIsVideo);
|
message->AddBool("isVideo", fIsVideo);
|
||||||
fRealtimeCheckBox = new BCheckBox("realtimeCheckBox",
|
fRealtimeCheckBox = new BCheckBox("realtimeCheckBox",
|
||||||
fIsVideo ? "Enable Real-Time Video" : "Enable Real-Time Audio",
|
fIsVideo ? TR("Enable Real-Time Video") : TR("Enable Real-Time Audio"),
|
||||||
message);
|
message);
|
||||||
|
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
@@ -125,10 +131,13 @@ SettingsView::SettingsView (bool isVideo)
|
|||||||
fRealtimeCheckBox->SetValue(B_CONTROL_ON);
|
fRealtimeCheckBox->SetValue(B_CONTROL_ON);
|
||||||
|
|
||||||
BTextView *textView = new BTextView("stringView");
|
BTextView *textView = new BTextView("stringView");
|
||||||
textView->Insert(fIsVideo ? "Enabling Real-Time Video allows system to perform video operations as fast and smoothly as possible. It achieves optimum performance by using more RAM."
|
textView->Insert(fIsVideo ? TR("Enabling Real-Time Video allows system to "
|
||||||
"\n\nOnly enable this feature if you need the lowest latency possible."
|
"perform video operations as fast and smoothly as possible. It "
|
||||||
: "Enabling Real-time Audio allows system to record and play audio as fast as possible. It achieves this performance by using more CPU and RAM."
|
"achieves optimum performance by using more RAM."
|
||||||
"\n\nOnly enable this feature if you need the lowest latency possible.");
|
"\n\nOnly enable this feature if you need the lowest latency possible.")
|
||||||
|
: TR("Enabling Real-time Audio allows system to record and play audio "
|
||||||
|
"as fast as possible. It achieves this performance by using more CPU and RAM."
|
||||||
|
"\n\nOnly enable this feature if you need the lowest latency possible."));
|
||||||
textView->MakeEditable(false);
|
textView->MakeEditable(false);
|
||||||
textView->MakeSelectable(false);
|
textView->MakeSelectable(false);
|
||||||
textView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
textView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
@@ -144,11 +153,11 @@ SettingsView::SettingsView (bool isVideo)
|
|||||||
// create the bottom line: volumen in deskbar checkbox and restart button
|
// create the bottom line: volumen in deskbar checkbox and restart button
|
||||||
BGroupView* bottomView = new BGroupView(B_HORIZONTAL);
|
BGroupView* bottomView = new BGroupView(B_HORIZONTAL);
|
||||||
BButton *restartButton = new BButton("restartButton",
|
BButton *restartButton = new BButton("restartButton",
|
||||||
"Restart Media Services", new BMessage(ML_RESTART_MEDIA_SERVER));
|
TR("Restart Media Services"), new BMessage(ML_RESTART_MEDIA_SERVER));
|
||||||
|
|
||||||
if (!fIsVideo) {
|
if (!fIsVideo) {
|
||||||
fVolumeCheckBox = new BCheckBox("volumeCheckBox",
|
fVolumeCheckBox = new BCheckBox("volumeCheckBox",
|
||||||
"Show Volume Control on Deskbar", new BMessage(ML_SHOW_VOLUME_CONTROL));
|
TR("Show Volume Control on Deskbar"), new BMessage(ML_SHOW_VOLUME_CONTROL));
|
||||||
bottomView->GroupLayout()->AddView(fVolumeCheckBox);
|
bottomView->GroupLayout()->AddView(fVolumeCheckBox);
|
||||||
if (BDeskbar().HasItem("MediaReplicant"))
|
if (BDeskbar().HasItem("MediaReplicant"))
|
||||||
fVolumeCheckBox->SetValue(B_CONTROL_ON);
|
fVolumeCheckBox->SetValue(B_CONTROL_ON);
|
||||||
|
|||||||
@@ -7,35 +7,41 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Alert.h>
|
||||||
|
#include <Application.h>
|
||||||
|
#include <Autolock.h>
|
||||||
|
#include <Bitmap.h>
|
||||||
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <Debug.h>
|
||||||
|
#include <Deskbar.h>
|
||||||
|
#include <GroupView.h>
|
||||||
|
#include <Locale.h>
|
||||||
#include <MediaTheme.h>
|
#include <MediaTheme.h>
|
||||||
#include <MediaRoster.h>
|
#include <MediaRoster.h>
|
||||||
#include <Alert.h>
|
|
||||||
#include <ScrollView.h>
|
|
||||||
#include <Bitmap.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <Screen.h>
|
|
||||||
#include <Application.h>
|
|
||||||
#include <StorageKit.h>
|
|
||||||
#include <Deskbar.h>
|
|
||||||
#include <Button.h>
|
|
||||||
#include <TextView.h>
|
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
#include <String.h>
|
#include <Screen.h>
|
||||||
#include <Debug.h>
|
#include <ScrollView.h>
|
||||||
#include <Autolock.h>
|
|
||||||
#include <GroupView.h>
|
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
|
#include <StorageKit.h>
|
||||||
|
#include <String.h>
|
||||||
|
#include <TextView.h>
|
||||||
#include "MediaWindow.h"
|
#include "MediaWindow.h"
|
||||||
|
|
||||||
// Images
|
// Images
|
||||||
#include "iconfile.h"
|
#include "iconfile.h"
|
||||||
|
|
||||||
|
#define TR_CONTEXT "Media Window"
|
||||||
|
|
||||||
const uint32 ML_SELECTED_NODE = 'MlSN';
|
const uint32 ML_SELECTED_NODE = 'MlSN';
|
||||||
const uint32 ML_INIT_MEDIA = 'MlIM';
|
const uint32 ML_INIT_MEDIA = 'MlIM';
|
||||||
|
|
||||||
// MediaWindow - Constructor
|
// MediaWindow - Constructor
|
||||||
MediaWindow::MediaWindow(BRect frame)
|
MediaWindow::MediaWindow(BRect frame)
|
||||||
: BWindow (frame, "Media", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
|
: BWindow (frame, TR("Media"), B_TITLED_WINDOW,
|
||||||
|
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||||
fCurrentNode(NULL),
|
fCurrentNode(NULL),
|
||||||
fParamWeb(NULL),
|
fParamWeb(NULL),
|
||||||
fAlert(NULL),
|
fAlert(NULL),
|
||||||
@@ -55,13 +61,13 @@ MediaWindow::InitCheck()
|
|||||||
// MediaWindow - Destructor
|
// MediaWindow - Destructor
|
||||||
MediaWindow::~MediaWindow()
|
MediaWindow::~MediaWindow()
|
||||||
{
|
{
|
||||||
for (int i=0; i<fAudioOutputs.CountItems(); i++)
|
for (int i = 0; i<fAudioOutputs.CountItems(); i++)
|
||||||
delete static_cast<dormant_node_info *>(fAudioOutputs.ItemAt(i));
|
delete static_cast<dormant_node_info *>(fAudioOutputs.ItemAt(i));
|
||||||
for (int i=0; i<fAudioInputs.CountItems(); i++)
|
for (int i = 0; i<fAudioInputs.CountItems(); i++)
|
||||||
delete static_cast<dormant_node_info *>(fAudioInputs.ItemAt(i));
|
delete static_cast<dormant_node_info *>(fAudioInputs.ItemAt(i));
|
||||||
for (int i=0; i<fVideoOutputs.CountItems(); i++)
|
for (int i = 0; i<fVideoOutputs.CountItems(); i++)
|
||||||
delete static_cast<dormant_node_info *>(fVideoOutputs.ItemAt(i));
|
delete static_cast<dormant_node_info *>(fVideoOutputs.ItemAt(i));
|
||||||
for (int i=0; i<fVideoInputs.CountItems(); i++)
|
for (int i = 0; i<fVideoInputs.CountItems(); i++)
|
||||||
delete static_cast<dormant_node_info *>(fVideoInputs.ItemAt(i));
|
delete static_cast<dormant_node_info *>(fVideoInputs.ItemAt(i));
|
||||||
|
|
||||||
BMediaRoster *roster = BMediaRoster::Roster();
|
BMediaRoster *roster = BMediaRoster::Roster();
|
||||||
@@ -71,7 +77,8 @@ MediaWindow::~MediaWindow()
|
|||||||
char buffer[512];
|
char buffer[512];
|
||||||
BRect rect = Frame();
|
BRect rect = Frame();
|
||||||
PRINT_OBJECT(rect);
|
PRINT_OBJECT(rect);
|
||||||
sprintf(buffer, "# MediaPrefs Settings\n rect = %i,%i,%i,%i\n", int(rect.left), int(rect.top), int(rect.right), int(rect.bottom));
|
sprintf(buffer, "# MediaPrefs Settings\n rect = %i,%i,%i,%i\n",
|
||||||
|
int(rect.left), int(rect.top), int(rect.right), int(rect.bottom));
|
||||||
|
|
||||||
BPath path;
|
BPath path;
|
||||||
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK) {
|
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK) {
|
||||||
@@ -98,16 +105,17 @@ MediaWindow::FindNodes(media_type type, uint64 kind, BList &list)
|
|||||||
format1 = &format;
|
format1 = &format;
|
||||||
else if (kind & B_PHYSICAL_INPUT)
|
else if (kind & B_PHYSICAL_INPUT)
|
||||||
format2 = &format;
|
format2 = &format;
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (roster->GetDormantNodes(node_info, &node_info_count, format1, format2, NULL, kind)!=B_OK) {
|
if (roster->GetDormantNodes(node_info, &node_info_count, format1, format2,
|
||||||
|
NULL, kind)!=B_OK) {
|
||||||
fprintf(stderr, "error\n");
|
fprintf(stderr, "error\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i=0; i<node_info_count; i++) {
|
for (int32 i = 0; i<node_info_count; i++) {
|
||||||
PRINT(("node : %s, media_addon %i, flavor_id %i\n",
|
PRINT(("node : %s, media_addon %i, flavor_id %i\n",
|
||||||
node_info[i].name, node_info[i].addon, node_info[i].flavor_id));
|
node_info[i].name, node_info[i].addon, node_info[i].flavor_id));
|
||||||
dormant_node_info *info = new dormant_node_info();
|
dormant_node_info *info = new dormant_node_info();
|
||||||
strcpy(info->name, node_info[i].name);
|
strcpy(info->name, node_info[i].name);
|
||||||
@@ -121,9 +129,11 @@ MediaWindow::FindNodes(media_type type, uint64 kind, BList &list)
|
|||||||
MediaListItem *
|
MediaListItem *
|
||||||
MediaWindow::FindMediaListItem(dormant_node_info *info)
|
MediaWindow::FindMediaListItem(dormant_node_info *info)
|
||||||
{
|
{
|
||||||
for (int32 j=0; j<fListView->CountItems(); j++) {
|
for (int32 j = 0; j<fListView->CountItems(); j++) {
|
||||||
MediaListItem *item = static_cast<MediaListItem *>(fListView->ItemAt(j));
|
MediaListItem *item
|
||||||
if (item->fInfo && item->fInfo->addon == info->addon && item->fInfo->flavor_id == info->flavor_id) {
|
= static_cast<MediaListItem *>(fListView->ItemAt(j));
|
||||||
|
if (item->fInfo && item->fInfo->addon == info->addon
|
||||||
|
&& item->fInfo->flavor_id == info->flavor_id) {
|
||||||
return item;
|
return item;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -135,8 +145,9 @@ MediaWindow::FindMediaListItem(dormant_node_info *info)
|
|||||||
void
|
void
|
||||||
MediaWindow::AddNodes(BList &list, bool isVideo)
|
MediaWindow::AddNodes(BList &list, bool isVideo)
|
||||||
{
|
{
|
||||||
for (int32 i=0; i<list.CountItems(); i++) {
|
for (int32 i = 0; i<list.CountItems(); i++) {
|
||||||
dormant_node_info *info = static_cast<dormant_node_info *>(list.ItemAt(i));
|
dormant_node_info *info
|
||||||
|
= static_cast<dormant_node_info *>(list.ItemAt(i));
|
||||||
if (!FindMediaListItem(info))
|
if (!FindMediaListItem(info))
|
||||||
fListView->AddItem(new MediaListItem(info, 1, isVideo, &fIcons));
|
fListView->AddItem(new MediaListItem(info, 1, isVideo, &fIcons));
|
||||||
}
|
}
|
||||||
@@ -144,31 +155,31 @@ MediaWindow::AddNodes(BList &list, bool isVideo)
|
|||||||
|
|
||||||
|
|
||||||
// MediaWindow::InitWindow -- Initialization Commands here
|
// MediaWindow::InitWindow -- Initialization Commands here
|
||||||
void
|
void
|
||||||
MediaWindow::InitWindow(void)
|
MediaWindow::InitWindow(void)
|
||||||
{
|
{
|
||||||
// Bitmaps
|
// Bitmaps
|
||||||
BRect iconRect(0, 0, 15, 15);
|
BRect iconRect(0, 0, 15, 15);
|
||||||
BBitmap *icon = new BBitmap(iconRect, B_CMAP8);
|
BBitmap *icon = new BBitmap(iconRect, B_CMAP8);
|
||||||
icon->SetBits(kDevicesBits, kDevicesWidth*kDevicesHeight, 0,
|
icon->SetBits(kDevicesBits, kDevicesWidth * kDevicesHeight, 0,
|
||||||
kDevicesColorSpace);
|
kDevicesColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
icon = new BBitmap(iconRect, B_CMAP8);
|
icon = new BBitmap(iconRect, B_CMAP8);
|
||||||
icon->SetBits(kMixerBits, kMixerWidth*kMixerHeight, 0,
|
icon->SetBits(kMixerBits, kMixerWidth * kMixerHeight, 0,
|
||||||
kMixerColorSpace);
|
kMixerColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
icon = new BBitmap(iconRect, B_CMAP8);
|
icon = new BBitmap(iconRect, B_CMAP8);
|
||||||
icon->SetBits(kMicBits, kMicWidth*kMicHeight, 0, kMicColorSpace);
|
icon->SetBits(kMicBits, kMicWidth * kMicHeight, 0, kMicColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
icon = new BBitmap(iconRect, B_CMAP8);
|
icon = new BBitmap(iconRect, B_CMAP8);
|
||||||
icon->SetBits(kSpeakerBits, kSpeakerWidth*kSpeakerHeight, 0,
|
icon->SetBits(kSpeakerBits, kSpeakerWidth * kSpeakerHeight, 0,
|
||||||
kSpeakerColorSpace);
|
kSpeakerColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
icon = new BBitmap(iconRect, B_CMAP8);
|
icon = new BBitmap(iconRect, B_CMAP8);
|
||||||
icon->SetBits(kCamBits, kCamWidth*kCamHeight, 0, kCamColorSpace);
|
icon->SetBits(kCamBits, kCamWidth * kCamHeight, 0, kCamColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
icon = new BBitmap(iconRect, B_CMAP8);
|
icon = new BBitmap(iconRect, B_CMAP8);
|
||||||
icon->SetBits(kTVBits, kTVWidth*kTVHeight, 0, kTVColorSpace);
|
icon->SetBits(kTVBits, kTVWidth * kTVHeight, 0, kTVColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
|
|
||||||
const float scrollWidth = 9 * be_plain_font->Size() + 30;
|
const float scrollWidth = 9 * be_plain_font->Size() + 30;
|
||||||
@@ -183,19 +194,19 @@ MediaWindow::InitWindow(void)
|
|||||||
scrollView->SetExplicitMaxSize(BSize(scrollWidth, B_SIZE_UNSET));
|
scrollView->SetExplicitMaxSize(BSize(scrollWidth, B_SIZE_UNSET));
|
||||||
|
|
||||||
// Create the Views
|
// Create the Views
|
||||||
fBox = new BBox("background", B_WILL_DRAW | B_FRAME_EVENTS,
|
fBox = new BBox("background", B_WILL_DRAW | B_FRAME_EVENTS,
|
||||||
B_PLAIN_BORDER);
|
B_PLAIN_BORDER);
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
GetLayout()->AddView(fBox);
|
GetLayout()->AddView(fBox);
|
||||||
|
|
||||||
// StringViews
|
// StringViews
|
||||||
rgb_color titleFontColor = { 0,0,0,0 };
|
rgb_color titleFontColor = { 0, 0, 0, 0 };
|
||||||
fTitleView = new BStringView("AudioSettings",
|
fTitleView = new BStringView("AudioSettings",
|
||||||
"Audio Settings", B_WILL_DRAW);
|
TR("Audio Settings"), B_WILL_DRAW);
|
||||||
fTitleView->SetFont(be_bold_font);
|
fTitleView->SetFont(be_bold_font);
|
||||||
fTitleView->SetHighColor(titleFontColor);
|
fTitleView->SetHighColor(titleFontColor);
|
||||||
|
|
||||||
fContentView = new BBox("contentView", B_WILL_DRAW | B_FRAME_EVENTS,
|
fContentView = new BBox("contentView", B_WILL_DRAW | B_FRAME_EVENTS,
|
||||||
B_NO_BORDER);
|
B_NO_BORDER);
|
||||||
|
|
||||||
fAudioView = new SettingsView(false);
|
fAudioView = new SettingsView(false);
|
||||||
@@ -242,15 +253,16 @@ MediaWindow::InitMedia(bool first)
|
|||||||
BMediaRoster *roster = BMediaRoster::Roster(&err);
|
BMediaRoster *roster = BMediaRoster::Roster(&err);
|
||||||
|
|
||||||
if (first && err != B_OK) {
|
if (first && err != B_OK) {
|
||||||
BAlert *alert = new BAlert("start_media_server",
|
BAlert *alert = new BAlert("start_media_server",
|
||||||
"Could not connect to the Media Server.\n"
|
TR("Could not connect to the Media Server.\n"
|
||||||
"Would you like to start it ?", "Quit", "Start Media Server", NULL,
|
"Would you like to start it ?"), TR("Quit"),
|
||||||
|
TR("Start Media Server"), NULL,
|
||||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||||
if (alert->Go()==0)
|
if (alert->Go()==0)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|
||||||
fAlert = new MediaAlert(BRect(0, 0, 300, 60),
|
fAlert = new MediaAlert(BRect(0, 0, 300, 60),
|
||||||
"restart_alert", "Restarting Media Services\nStarting Media Server" B_UTF8_ELLIPSIS "\n");
|
"restart_alert", TR("Restarting Media Services\nStarting Media Server" B_UTF8_ELLIPSIS "\n"));
|
||||||
fAlert->Show();
|
fAlert->Show();
|
||||||
|
|
||||||
Show();
|
Show();
|
||||||
@@ -267,7 +279,7 @@ MediaWindow::InitMedia(bool first)
|
|||||||
if ((!first || (first && err) ) && fAlert) {
|
if ((!first || (first && err) ) && fAlert) {
|
||||||
BAutolock locker(fAlert);
|
BAutolock locker(fAlert);
|
||||||
if (locker.IsLocked())
|
if (locker.IsLocked())
|
||||||
fAlert->TextView()->SetText("Ready For Use" B_UTF8_ELLIPSIS);
|
fAlert->TextView()->SetText(TR("Ready For Use" B_UTF8_ELLIPSIS));
|
||||||
}
|
}
|
||||||
|
|
||||||
void *listItem;
|
void *listItem;
|
||||||
@@ -393,7 +405,7 @@ MediaWindow::QuitRequested()
|
|||||||
|
|
||||||
|
|
||||||
// MediaWindow::FrameResized -- When the main frame is resized fix up the other views
|
// MediaWindow::FrameResized -- When the main frame is resized fix up the other views
|
||||||
void
|
void
|
||||||
MediaWindow::FrameResized (float width, float height)
|
MediaWindow::FrameResized (float width, float height)
|
||||||
{
|
{
|
||||||
// This makes sure our SideBar colours down to the bottom when resized
|
// This makes sure our SideBar colours down to the bottom when resized
|
||||||
@@ -403,10 +415,10 @@ MediaWindow::FrameResized (float width, float height)
|
|||||||
// ---------------------------------------------------------------------------------------------------------- //
|
// ---------------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
// ErrorAlert -- Displays a BAlert Box with a Custom Error or Debug Message
|
// ErrorAlert -- Displays a BAlert Box with a Custom Error or Debug Message
|
||||||
void
|
void
|
||||||
ErrorAlert(char* errorMessage) {
|
ErrorAlert(char* errorMessage) {
|
||||||
printf("%s\n", errorMessage);
|
printf("%s\n", errorMessage);
|
||||||
BAlert *alert = new BAlert("BAlert", errorMessage, "OK", NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
BAlert *alert = new BAlert("BAlert", errorMessage, TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
|
||||||
alert->Go();
|
alert->Go();
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@@ -414,7 +426,7 @@ ErrorAlert(char* errorMessage) {
|
|||||||
|
|
||||||
|
|
||||||
// MediaWindow::MessageReceived -- receives messages
|
// MediaWindow::MessageReceived -- receives messages
|
||||||
void
|
void
|
||||||
MediaWindow::MessageReceived (BMessage *message)
|
MediaWindow::MessageReceived (BMessage *message)
|
||||||
{
|
{
|
||||||
switch(message->what)
|
switch(message->what)
|
||||||
@@ -435,7 +447,7 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
|
|
||||||
if (fAudioView->fRestartView->IsHidden())
|
if (fAudioView->fRestartView->IsHidden())
|
||||||
fAudioView->fRestartView->Show();
|
fAudioView->fRestartView->Show();
|
||||||
} else
|
} else
|
||||||
fprintf(stderr, "Settings2Item not found\n");
|
fprintf(stderr, "Settings2Item not found\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -472,9 +484,9 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MediaListItem *oldListItem = NULL;
|
MediaListItem *oldListItem = NULL;
|
||||||
for (int32 j=0; j<fListView->CountItems(); j++) {
|
for (int32 j = 0; j<fListView->CountItems(); j++) {
|
||||||
oldListItem = static_cast<MediaListItem *>(fListView->ItemAt(j));
|
oldListItem = static_cast<MediaListItem *>(fListView->ItemAt(j));
|
||||||
if (oldListItem->fInfo && oldListItem->IsVideo() == isVideo
|
if (oldListItem->fInfo && oldListItem->IsVideo() == isVideo
|
||||||
&& oldListItem->IsDefault(isInput))
|
&& oldListItem->IsDefault(isInput))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -486,13 +498,13 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
MediaListItem *listItem = FindMediaListItem(item->fInfo);
|
MediaListItem *listItem = FindMediaListItem(item->fInfo);
|
||||||
if (listItem) {
|
if (listItem) {
|
||||||
listItem->SetDefault(true, isInput);
|
listItem->SetDefault(true, isInput);
|
||||||
} else
|
} else
|
||||||
fprintf(stderr, "MediaListItem not found\n");
|
fprintf(stderr, "MediaListItem not found\n");
|
||||||
fListView->Invalidate();
|
fListView->Invalidate();
|
||||||
|
|
||||||
if (settingsView->fRestartView->IsHidden())
|
if (settingsView->fRestartView->IsHidden())
|
||||||
settingsView->fRestartView->Show();
|
settingsView->fRestartView->Show();
|
||||||
} else
|
} else
|
||||||
fprintf(stderr, "SettingsItem not found\n");
|
fprintf(stderr, "SettingsItem not found\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -518,13 +530,13 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
status = deskbar.AddItem(&ref, &id);
|
status = deskbar.AddItem(&ref, &id);
|
||||||
|
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fprintf(stderr, "Couldn't add Volume control in Deskbar: %s\n",
|
fprintf(stderr, TR("Couldn't add Volume control in Deskbar: %s\n"),
|
||||||
strerror(status));
|
strerror(status));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
status_t status = deskbar.RemoveItem("MediaReplicant");
|
status_t status = deskbar.RemoveItem("MediaReplicant");
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fprintf(stderr, "Couldn't remove Volume control in Deskbar: %s\n",
|
fprintf(stderr, TR("Couldn't remove Volume control in Deskbar: %s\n"),
|
||||||
strerror(status));
|
strerror(status));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -602,7 +614,7 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
fParamWeb = NULL;
|
fParamWeb = NULL;
|
||||||
BRect bounds = fContentView->Bounds();
|
BRect bounds = fContentView->Bounds();
|
||||||
BStringView* stringView = new BStringView(bounds,
|
BStringView* stringView = new BStringView(bounds,
|
||||||
"noControls", "This hardware has no controls.", B_FOLLOW_V_CENTER | B_FOLLOW_H_CENTER);
|
"noControls", TR("This hardware has no controls."), B_FOLLOW_V_CENTER | B_FOLLOW_H_CENTER);
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
fContentView->AddChild(stringView);
|
fContentView->AddChild(stringView);
|
||||||
stringView->MoveBy((bounds.Width()-stringView->Bounds().Width())/2,
|
stringView->MoveBy((bounds.Width()-stringView->Bounds().Width())/2,
|
||||||
@@ -625,7 +637,7 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
&& (strcmp(mimeSig, "application/x-vnd.Be.addon-host")==0
|
&& (strcmp(mimeSig, "application/x-vnd.Be.addon-host")==0
|
||||||
|| strcmp(mimeSig, "application/x-vnd.Be.media-server")==0)) {
|
|| strcmp(mimeSig, "application/x-vnd.Be.media-server")==0)) {
|
||||||
fAlert->Lock();
|
fAlert->Lock();
|
||||||
fAlert->TextView()->SetText("Starting Media Server" B_UTF8_ELLIPSIS);
|
fAlert->TextView()->SetText(TR("Starting Media Server" B_UTF8_ELLIPSIS));
|
||||||
fAlert->Unlock();
|
fAlert->Unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -656,7 +668,7 @@ MediaWindow::RestartMediaServices(void *data)
|
|||||||
{
|
{
|
||||||
MediaWindow *window = (MediaWindow *)data;
|
MediaWindow *window = (MediaWindow *)data;
|
||||||
window->fAlert = new MediaAlert(BRect(0, 0, 300, 60),
|
window->fAlert = new MediaAlert(BRect(0, 0, 300, 60),
|
||||||
"restart_alert", "Restarting Media Services\nShutting down Media Server\n");
|
"restart_alert", TR("Restarting Media Services\nShutting down Media Server\n"));
|
||||||
|
|
||||||
window->fAlert->Show();
|
window->fAlert->Show();
|
||||||
|
|
||||||
@@ -665,7 +677,7 @@ MediaWindow::RestartMediaServices(void *data)
|
|||||||
{
|
{
|
||||||
BAutolock locker(window->fAlert);
|
BAutolock locker(window->fAlert);
|
||||||
if (locker.IsLocked())
|
if (locker.IsLocked())
|
||||||
window->fAlert->TextView()->SetText("Starting Media Server" B_UTF8_ELLIPSIS);
|
window->fAlert->TextView()->SetText(TR("Starting Media Server" B_UTF8_ELLIPSIS));
|
||||||
}
|
}
|
||||||
launch_media_server();
|
launch_media_server();
|
||||||
|
|
||||||
@@ -677,22 +689,22 @@ MediaWindow::UpdateProgress(int stage, const char * message, void * cookie)
|
|||||||
{
|
{
|
||||||
MediaAlert *alert = static_cast<MediaAlert*>(cookie);
|
MediaAlert *alert = static_cast<MediaAlert*>(cookie);
|
||||||
PRINT(("stage : %i\n", stage));
|
PRINT(("stage : %i\n", stage));
|
||||||
const char *string = "Unknown stage";
|
const char *string = "Unknown stage";
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case 10:
|
case 10:
|
||||||
string = "Stopping Media Server" B_UTF8_ELLIPSIS;
|
string = TR("Stopping Media Server" B_UTF8_ELLIPSIS);
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
string = "Telling media_addon_server to quit.";
|
string = TR("Telling media_addon_server to quit.");
|
||||||
break;
|
break;
|
||||||
case 40:
|
case 40:
|
||||||
string = "Waiting for media_server to quit.";
|
string = TR("Waiting for media_server to quit.");
|
||||||
break;
|
break;
|
||||||
case 70:
|
case 70:
|
||||||
string = "Cleaning Up.";
|
string = TR("Cleaning Up.");
|
||||||
break;
|
break;
|
||||||
case 100:
|
case 100:
|
||||||
string = "Done Shutting Down.";
|
string = TR("Done Shutting Down.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user