style cleanup
whitespace => tab git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23505 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -13,7 +13,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Appearance",
|
short_info = "Appearance",
|
||||||
long_info = "Appearance ©2002-2007 Haiku"
|
long_info = "Appearance ©2002-2007 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
@@ -313,8 +313,8 @@ BackgroundImage::Show(BackgroundImageInfo *info, BView *view)
|
|||||||
followFlags, tile);
|
followFlags, tile);
|
||||||
view->Invalidate();
|
view->Invalidate();
|
||||||
|
|
||||||
/*if(fShowingBitmap != info) {
|
/*if (fShowingBitmap != info) {
|
||||||
if(fShowingBitmap)
|
if (fShowingBitmap)
|
||||||
fShowingBitmap->UnloadBitmap(fCacheMode);
|
fShowingBitmap->UnloadBitmap(fCacheMode);
|
||||||
fShowingBitmap = info;
|
fShowingBitmap = info;
|
||||||
}*/
|
}*/
|
||||||
@@ -484,8 +484,8 @@ BackgroundImage::Refresh(BackgroundImage *oldBackgroundImage,
|
|||||||
void
|
void
|
||||||
BackgroundImage::ChangeImageSet(BPoseView *poseView)
|
BackgroundImage::ChangeImageSet(BPoseView *poseView)
|
||||||
{
|
{
|
||||||
if(fRandomChange) {
|
if (fRandomChange) {
|
||||||
if(fImageSetCount > 1) {
|
if (fImageSetCount > 1) {
|
||||||
uint32 oldShowingImageSet = fShowingImageSet;
|
uint32 oldShowingImageSet = fShowingImageSet;
|
||||||
while(oldShowingImageSet == fShowingImageSet)
|
while(oldShowingImageSet == fShowingImageSet)
|
||||||
fShowingImageSet = random()%fImageSetCount;
|
fShowingImageSet = random()%fImageSetCount;
|
||||||
@@ -493,7 +493,7 @@ BackgroundImage::ChangeImageSet(BPoseView *poseView)
|
|||||||
fShowingImageSet = 0;
|
fShowingImageSet = 0;
|
||||||
} else {
|
} else {
|
||||||
fShowingImageSet++;
|
fShowingImageSet++;
|
||||||
if(fShowingImageSet > fImageSetCount - 1)
|
if (fShowingImageSet > fImageSetCount - 1)
|
||||||
fShowingImageSet = 0;
|
fShowingImageSet = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Backgrounds",
|
short_info = "Backgrounds",
|
||||||
long_info = "Backgrounds ©2002-2006 Haiku"
|
long_info = "Backgrounds ©2002-2006 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ RangeConfItem::DrawItem(BView *owner, BRect itemRect, bool complete)
|
|||||||
owner->SetLowColor(color);
|
owner->SetLowColor(color);
|
||||||
owner->FillRect(itemRect);
|
owner->FillRect(itemRect);
|
||||||
owner->SetHighColor(kBlack);
|
owner->SetHighColor(kBlack);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
owner->SetLowColor(owner->ViewColor());
|
owner->SetLowColor(owner->ViewColor());
|
||||||
}
|
}
|
||||||
@@ -173,12 +172,12 @@ ConfigurationWindow::InitWindow(void)
|
|||||||
BRect rtab = Bounds();
|
BRect rtab = Bounds();
|
||||||
BRect rlist = Bounds();
|
BRect rlist = Bounds();
|
||||||
rtab.top += 10;
|
rtab.top += 10;
|
||||||
rlist.top += 11;
|
rlist.top += 11;
|
||||||
rlist.left += 13;
|
rlist.left += 13;
|
||||||
rlist.right -= 13;
|
rlist.right -= 13;
|
||||||
rlist.bottom -= 44;
|
rlist.bottom -= 44;
|
||||||
|
|
||||||
// Create the TabView and Tabs
|
// Create the TabView and Tabs
|
||||||
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
|
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
|
||||||
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
@@ -266,9 +265,9 @@ ConfigurationWindow::InitWindow(void)
|
|||||||
|
|
||||||
BRect boxRect = resources->Bounds();
|
BRect boxRect = resources->Bounds();
|
||||||
boxRect.top = 74;
|
boxRect.top = 74;
|
||||||
boxRect.left += 13;
|
boxRect.left += 13;
|
||||||
boxRect.right -= 11;
|
boxRect.right -= 11;
|
||||||
boxRect.bottom = boxRect.top + 141;
|
boxRect.bottom = boxRect.top + 141;
|
||||||
BBox *ioPortBox = new BBox(boxRect, "ioPort",
|
BBox *ioPortBox = new BBox(boxRect, "ioPort",
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
|
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
|
||||||
ioPortBox->SetLabel(new BStringView(BRect(0,0,150,15), "ioPortLabel", " IO Port Ranges "));
|
ioPortBox->SetLabel(new BStringView(BRect(0,0,150,15), "ioPortLabel", " IO Port Ranges "));
|
||||||
@@ -624,7 +623,7 @@ bool
|
|||||||
ConfigurationWindow::QuitRequested()
|
ConfigurationWindow::QuitRequested()
|
||||||
{
|
{
|
||||||
fItem->SetWindow(NULL);
|
fItem->SetWindow(NULL);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------------------------------------- //
|
// ---------------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
class Devices : public BApplication
|
class Devices : public BApplication
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Devices();
|
Devices();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -47,20 +47,21 @@ void Devices::MessageReceived (BMessage *message)
|
|||||||
{
|
{
|
||||||
switch(message->what)
|
switch(message->what)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message); // pass it along ...
|
BApplication::MessageReceived(message); // pass it along ...
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------------------------------------- //
|
// ---------------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
|
|
||||||
// Devices Main
|
// Devices Main
|
||||||
int main(void)
|
int
|
||||||
|
main(void)
|
||||||
{
|
{
|
||||||
Devices theApp;
|
Devices theApp;
|
||||||
theApp.Run();
|
theApp.Run();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// end ------------------------------------------------------------------------------------------------------ //
|
// end ------------------------------------------------------------------------------------------------------ //
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ resource app_version
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Devices",
|
short_info = "Devices",
|
||||||
long_info = "Devices ©2002-2007 Haiku"
|
long_info = "Devices ©2002-2007 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ DeviceItem::DrawItem(BView *owner, BRect itemRect, bool complete)
|
|||||||
owner->MovePenTo(point);
|
owner->MovePenTo(point);
|
||||||
owner->DrawString(fName);
|
owner->DrawString(fName);
|
||||||
|
|
||||||
if(fInfo) {
|
if (fInfo) {
|
||||||
point += BPoint(222, 0);
|
point += BPoint(222, 0);
|
||||||
BString string = "enabled";
|
BString string = "enabled";
|
||||||
if (!(fInfo->GetInfo()->flags & B_DEVICE_INFO_ENABLED))
|
if (!(fInfo->GetInfo()->flags & B_DEVICE_INFO_ENABLED))
|
||||||
|
|||||||
@@ -23,10 +23,10 @@
|
|||||||
class DevicesInfo
|
class DevicesInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DevicesInfo(struct device_info *info,
|
DevicesInfo(struct device_info *info,
|
||||||
struct device_configuration *current,
|
struct device_configuration *current,
|
||||||
struct possible_device_configurations *possible);
|
struct possible_device_configurations *possible);
|
||||||
~DevicesInfo();
|
~DevicesInfo();
|
||||||
struct device_info * GetInfo() { return fInfo;}
|
struct device_info * GetInfo() { return fInfo;}
|
||||||
char * GetDeviceName() const { return fDeviceName; }
|
char * GetDeviceName() const { return fDeviceName; }
|
||||||
char * GetCardName() const { return fCardName; }
|
char * GetCardName() const { return fCardName; }
|
||||||
|
|||||||
@@ -69,25 +69,25 @@ DevicesWindow::DevicesWindow(BRect frame) : BWindow (frame, "Devices", B_TITLED_
|
|||||||
CenterWindowOnScreen(this);
|
CenterWindowOnScreen(this);
|
||||||
|
|
||||||
// Load User Settings
|
// Load User Settings
|
||||||
BPath path;
|
BPath path;
|
||||||
find_directory(B_USER_SETTINGS_DIRECTORY,&path);
|
find_directory(B_USER_SETTINGS_DIRECTORY,&path);
|
||||||
path.Append("Devices_Settings",true);
|
path.Append("Devices_Settings",true);
|
||||||
BFile file(path.Path(),B_READ_ONLY);
|
BFile file(path.Path(),B_READ_ONLY);
|
||||||
BMessage msg;
|
BMessage msg;
|
||||||
msg.Unflatten(&file);
|
msg.Unflatten(&file);
|
||||||
LoadSettings (&msg);
|
LoadSettings (&msg);
|
||||||
|
|
||||||
status_t error;
|
status_t error;
|
||||||
|
|
||||||
if ((error = init_cm_wrapper()) < 0) {
|
if ((error = init_cm_wrapper()) < 0) {
|
||||||
printf("Error initializing configuration manager (%s)\n", strerror(error));
|
printf("Error initializing configuration manager (%s)\n", strerror(error));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
InitDevices(B_ISA_BUS);
|
InitDevices(B_ISA_BUS);
|
||||||
InitDevices(B_PCI_BUS);
|
InitDevices(B_PCI_BUS);
|
||||||
|
|
||||||
for (int32 i=fList.CountItems()-1; i>=0; i--) {
|
for (int32 i=fList.CountItems()-1; i>=0; i--) {
|
||||||
DevicesInfo *deviceInfo = (DevicesInfo *) fList.ItemAt(i);
|
DevicesInfo *deviceInfo = (DevicesInfo *) fList.ItemAt(i);
|
||||||
struct device_info *info = deviceInfo->GetInfo();
|
struct device_info *info = deviceInfo->GetInfo();
|
||||||
BListItem *item = systemMenu;
|
BListItem *item = systemMenu;
|
||||||
@@ -253,7 +253,7 @@ bool DevicesWindow::QuitRequested()
|
|||||||
{
|
{
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// ---------------------------------------------------------------------------------------------------------- //
|
// ---------------------------------------------------------------------------------------------------------- //
|
||||||
|
|
||||||
@@ -277,12 +277,12 @@ void DevicesWindow::SaveSettings(void)
|
|||||||
BMessage msg;
|
BMessage msg;
|
||||||
msg.AddRect("windowframe",Frame());
|
msg.AddRect("windowframe",Frame());
|
||||||
|
|
||||||
BPath path;
|
BPath path;
|
||||||
status_t result = find_directory(B_USER_SETTINGS_DIRECTORY,&path);
|
status_t result = find_directory(B_USER_SETTINGS_DIRECTORY,&path);
|
||||||
if (result == B_OK)
|
if (result == B_OK)
|
||||||
{
|
{
|
||||||
path.Append("Devices_Settings",true);
|
path.Append("Devices_Settings",true);
|
||||||
BFile file(path.Path(),B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
|
BFile file(path.Path(),B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
|
||||||
msg.Flatten(&file);
|
msg.Flatten(&file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ void CenterWindowOnScreen(BWindow* w);
|
|||||||
|
|
||||||
class ResourceUsageWindow : public BWindow {
|
class ResourceUsageWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
ResourceUsageWindow(BRect frame, BList &);
|
ResourceUsageWindow(BRect frame, BList &);
|
||||||
~ResourceUsageWindow();
|
~ResourceUsageWindow();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InitWindow(BList &);
|
void InitWindow(BList &);
|
||||||
@@ -46,19 +46,19 @@ class ResourceUsageWindow : public BWindow {
|
|||||||
|
|
||||||
class ModemWindow : public BWindow {
|
class ModemWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
ModemWindow(BRect frame, BMessenger);
|
ModemWindow(BRect frame, BMessenger);
|
||||||
~ModemWindow();
|
~ModemWindow();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
private:
|
private:
|
||||||
void InitWindow(void);
|
void InitWindow(void);
|
||||||
BMessenger fMessenger;
|
BMessenger fMessenger;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ConfigurationWindow : public BWindow {
|
class ConfigurationWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
ConfigurationWindow(BRect frame, DeviceItem *item);
|
ConfigurationWindow(BRect frame, DeviceItem *item);
|
||||||
~ConfigurationWindow();
|
~ConfigurationWindow();
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
private:
|
private:
|
||||||
void InitWindow(void);
|
void InitWindow(void);
|
||||||
@@ -74,9 +74,9 @@ class ConfigurationWindow : public BWindow {
|
|||||||
|
|
||||||
class DevicesWindow : public BWindow {
|
class DevicesWindow : public BWindow {
|
||||||
public:
|
public:
|
||||||
DevicesWindow(BRect frame);
|
DevicesWindow(BRect frame);
|
||||||
~DevicesWindow();
|
~DevicesWindow();
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
private:
|
private:
|
||||||
void InitWindow(void);
|
void InitWindow(void);
|
||||||
@@ -89,15 +89,15 @@ class DevicesWindow : public BWindow {
|
|||||||
ResourceUsageWindow* ptrResourceUsageWindow;
|
ResourceUsageWindow* ptrResourceUsageWindow;
|
||||||
ModemWindow* ptrModemWindow;
|
ModemWindow* ptrModemWindow;
|
||||||
|
|
||||||
BStringView *stvDeviceName;
|
BStringView *stvDeviceName;
|
||||||
BStringView *stvCurrentState;
|
BStringView *stvCurrentState;
|
||||||
BMenuBar *menubar;
|
BMenuBar *menubar;
|
||||||
|
|
||||||
BList fList;
|
BList fList;
|
||||||
|
|
||||||
BListItem *systemMenu, *isaMenu, *pciMenu, *jumperedMenu;
|
BListItem *systemMenu, *isaMenu, *pciMenu, *jumperedMenu;
|
||||||
BOutlineListView *outline;
|
BOutlineListView *outline;
|
||||||
BStringView *stvIRQ;
|
BStringView *stvIRQ;
|
||||||
BStringView *stvDMA;
|
BStringView *stvDMA;
|
||||||
BStringView *stvIORanges;
|
BStringView *stvIORanges;
|
||||||
BStringView *stvMemoryRanges;
|
BStringView *stvMemoryRanges;
|
||||||
|
|||||||
@@ -208,12 +208,12 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
BRect rtab = Bounds();
|
BRect rtab = Bounds();
|
||||||
BRect rlist = Bounds();
|
BRect rlist = Bounds();
|
||||||
rtab.top += 10;
|
rtab.top += 10;
|
||||||
rlist.top += 10;
|
rlist.top += 10;
|
||||||
rlist.left += 12;
|
rlist.left += 12;
|
||||||
rlist.right -= 15 + B_V_SCROLL_BAR_WIDTH;
|
rlist.right -= 15 + B_V_SCROLL_BAR_WIDTH;
|
||||||
rlist.bottom -= 47;
|
rlist.bottom -= 47;
|
||||||
|
|
||||||
// Create the TabView and Tabs
|
// Create the TabView and Tabs
|
||||||
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
|
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
|
||||||
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ status_t get_possible_configurations_for(uint64 id,
|
|||||||
|
|
||||||
|
|
||||||
status_t count_resource_descriptors_of_type(
|
status_t count_resource_descriptors_of_type(
|
||||||
struct device_configuration *c, resource_type type)
|
struct device_configuration *c, resource_type type)
|
||||||
{
|
{
|
||||||
struct cm_ioctl_data params;
|
struct cm_ioctl_data params;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "DriveSetup",
|
short_info = "DriveSetup",
|
||||||
long_info = "DriveSetup ©2002-2007 Haiku"
|
long_info = "DriveSetup ©2002-2007 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
@@ -179,8 +179,8 @@ bool
|
|||||||
MainWindow::QuitRequested()
|
MainWindow::QuitRequested()
|
||||||
{
|
{
|
||||||
// TODO: ask about any unsaved changes
|
// TODO: ask about any unsaved changes
|
||||||
be_app->PostMessage(B_QUIT_REQUESTED);
|
be_app->PostMessage(B_QUIT_REQUESTED);
|
||||||
Hide();
|
Hide();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Keyboard",
|
short_info = "Keyboard",
|
||||||
long_info = "Keyboard ©2004-2007 Haiku"
|
long_info = "Keyboard ©2004-2007 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
|
|||||||
@@ -36,12 +36,12 @@ KeyboardSettings::KeyboardSettings()
|
|||||||
fCorner.y = 100;
|
fCorner.y = 100;
|
||||||
|
|
||||||
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
|
||||||
if(status == B_OK) {
|
if (status == B_OK) {
|
||||||
status = path.Append(kb_settings_file);
|
status = path.Append(kb_settings_file);
|
||||||
if(status == B_OK) {
|
if (status == B_OK) {
|
||||||
status = file.SetTo(path.Path(), B_READ_ONLY);
|
status = file.SetTo(path.Path(), B_READ_ONLY);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
if(file.ReadAt(sizeof(kb_settings), &fCorner, sizeof(fCorner)) != sizeof(fCorner)) {
|
if (file.ReadAt(sizeof(kb_settings), &fCorner, sizeof(fCorner)) != sizeof(fCorner)) {
|
||||||
fCorner.x = 150;
|
fCorner.x = 150;
|
||||||
fCorner.y = 100;
|
fCorner.y = 100;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ KeyboardWindow::MessageReceived(BMessage* message)
|
|||||||
if (button !=NULL)
|
if (button !=NULL)
|
||||||
button->SetEnabled(false);
|
button->SetEnabled(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SLIDER_REPEAT_RATE:
|
case SLIDER_REPEAT_RATE:
|
||||||
{
|
{
|
||||||
int32 rate;
|
int32 rate;
|
||||||
@@ -133,7 +133,7 @@ KeyboardWindow::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
button = (BButton *)FindView("keyboard_revert");
|
button = (BButton *)FindView("keyboard_revert");
|
||||||
if (button !=NULL)
|
if (button !=NULL)
|
||||||
button->SetEnabled(true);
|
button->SetEnabled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SLIDER_DELAY_RATE:
|
case SLIDER_DELAY_RATE:
|
||||||
@@ -165,10 +165,10 @@ KeyboardWindow::MessageReceived(BMessage* message)
|
|||||||
button->SetEnabled(fSettings.IsDefaultable());
|
button->SetEnabled(fSettings.IsDefaultable());
|
||||||
|
|
||||||
button = (BButton *)FindView("keyboard_revert");
|
button = (BButton *)FindView("keyboard_revert");
|
||||||
if (button !=NULL)
|
if (button !=NULL)
|
||||||
button->SetEnabled(true);
|
button->SetEnabled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(message);
|
BWindow::MessageReceived(message);
|
||||||
|
|||||||
@@ -21,34 +21,34 @@
|
|||||||
#include <input_globals.h>
|
#include <input_globals.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_key( char *chars, int32 offset )
|
print_key(char *chars, int32 offset)
|
||||||
{
|
{
|
||||||
int size = chars[offset++];
|
int size = chars[offset++];
|
||||||
|
|
||||||
switch( size ) {
|
switch(size) {
|
||||||
case 0:
|
case 0:
|
||||||
// Not mapped
|
// Not mapped
|
||||||
printf( "N/A" );
|
printf("N/A");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
// 1-byte UTF-8/ASCII character
|
// 1-byte UTF-8/ASCII character
|
||||||
printf( "%c", chars[offset] );
|
printf("%c", chars[offset]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// 2-, 3-, or 4-byte UTF-8 character
|
// 2-, 3-, or 4-byte UTF-8 character
|
||||||
{
|
{
|
||||||
char *str = new char[size + 1];
|
char *str = new char[size + 1];
|
||||||
strncpy( str, &(chars[offset]), size );
|
strncpy(str, &(chars[offset]), size);
|
||||||
str[size] = 0;
|
str[size] = 0;
|
||||||
printf( "%s", str );
|
printf("%s", str);
|
||||||
delete [] str;
|
delete [] str;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf( "\t" );
|
printf("\t");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -57,19 +57,19 @@ Keymap::DumpKeymap()
|
|||||||
{
|
{
|
||||||
// Print a chart of the normal, shift, option, and option+shift
|
// Print a chart of the normal, shift, option, and option+shift
|
||||||
// keys.
|
// keys.
|
||||||
printf( "Key #\tNormal\tShift\tCaps\tC+S\tOption\tO+S\tO+C\tO+C+S\tControl\n" );
|
printf("Key #\tNormal\tShift\tCaps\tC+S\tOption\tO+S\tO+C\tO+C+S\tControl\n");
|
||||||
for( int idx = 0; idx < 128; idx++ ) {
|
for (int idx = 0; idx < 128; idx++) {
|
||||||
printf( " 0x%x\t", idx );
|
printf(" 0x%x\t", idx );
|
||||||
print_key( fChars, fKeys.normal_map[idx] );
|
print_key(fChars, fKeys.normal_map[idx]);
|
||||||
print_key( fChars, fKeys.shift_map[idx] );
|
print_key(fChars, fKeys.shift_map[idx]);
|
||||||
print_key( fChars, fKeys.caps_map[idx] );
|
print_key(fChars, fKeys.caps_map[idx]);
|
||||||
print_key( fChars, fKeys.caps_shift_map[idx] );
|
print_key(fChars, fKeys.caps_shift_map[idx]);
|
||||||
print_key( fChars, fKeys.option_map[idx] );
|
print_key(fChars, fKeys.option_map[idx]);
|
||||||
print_key( fChars, fKeys.option_shift_map[idx] );
|
print_key(fChars, fKeys.option_shift_map[idx]);
|
||||||
print_key( fChars, fKeys.option_caps_map[idx] );
|
print_key(fChars, fKeys.option_caps_map[idx]);
|
||||||
print_key( fChars, fKeys.option_caps_shift_map[idx] );
|
print_key(fChars, fKeys.option_caps_shift_map[idx]);
|
||||||
print_key( fChars, fKeys.control_map[idx] );
|
print_key(fChars, fKeys.control_map[idx]);
|
||||||
printf( "\n" );
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -371,7 +371,7 @@ Keymap::GetChars(uint32 keyCode, uint32 modifiers, uint8 activeDeadKey, char** c
|
|||||||
if (strncmp(&(fChars[offset+1]), &(fChars[dead_key[i]+1]), *numBytes ) == 0) {
|
if (strncmp(&(fChars[offset+1]), &(fChars[dead_key[i]+1]), *numBytes ) == 0) {
|
||||||
*numBytes = fChars[dead_key[i+1]];
|
*numBytes = fChars[dead_key[i+1]];
|
||||||
|
|
||||||
switch( *numBytes ) {
|
switch(*numBytes) {
|
||||||
case 0:
|
case 0:
|
||||||
// Not mapped
|
// Not mapped
|
||||||
*chars = NULL;
|
*chars = NULL;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Keymap",
|
short_info = "Keymap",
|
||||||
long_info = "Keymap ©2004-2006 Haiku"
|
long_info = "Keymap ©2004-2006 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ KeymapWindow::AddMenuBar()
|
|||||||
menubar->AddItem( menu );
|
menubar->AddItem( menu );
|
||||||
|
|
||||||
// Create the Font menu
|
// Create the Font menu
|
||||||
fFontMenu = new BMenu( "Font" );
|
fFontMenu = new BMenu("Font");
|
||||||
fFontMenu->SetRadioMode(true);
|
fFontMenu->SetRadioMode(true);
|
||||||
int32 numFamilies = count_font_families();
|
int32 numFamilies = count_font_families();
|
||||||
font_family family, current_family;
|
font_family family, current_family;
|
||||||
@@ -166,14 +166,14 @@ KeymapWindow::AddMenuBar()
|
|||||||
be_plain_font->GetFamilyAndStyle(¤t_family, ¤t_style);
|
be_plain_font->GetFamilyAndStyle(¤t_family, ¤t_style);
|
||||||
|
|
||||||
for (int32 i = 0; i < numFamilies; i++ )
|
for (int32 i = 0; i < numFamilies; i++ )
|
||||||
if ( get_font_family(i, &family, &flags) == B_OK ) {
|
if (get_font_family(i, &family, &flags) == B_OK) {
|
||||||
BMenuItem *item =
|
BMenuItem *item =
|
||||||
new BMenuItem(family, new BMessage( MENU_FONT_CHANGED));
|
new BMenuItem(family, new BMessage( MENU_FONT_CHANGED));
|
||||||
fFontMenu->AddItem(item);
|
fFontMenu->AddItem(item);
|
||||||
if(strcmp(family, current_family) == 0)
|
if (strcmp(family, current_family) == 0)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
menubar->AddItem( fFontMenu );
|
menubar->AddItem(fFontMenu);
|
||||||
|
|
||||||
return menubar;
|
return menubar;
|
||||||
}
|
}
|
||||||
@@ -207,7 +207,7 @@ KeymapWindow::AddMaps(BView *placeholderView)
|
|||||||
fUserListView = new BListView( bounds, "userList" );
|
fUserListView = new BListView( bounds, "userList" );
|
||||||
// '(Current)'
|
// '(Current)'
|
||||||
KeymapListItem *currentKeymapItem = (KeymapListItem*)fUserListView->FirstItem();
|
KeymapListItem *currentKeymapItem = (KeymapListItem*)fUserListView->FirstItem();
|
||||||
if( currentKeymapItem != NULL )
|
if (currentKeymapItem != NULL)
|
||||||
fUserListView->AddItem( currentKeymapItem );
|
fUserListView->AddItem( currentKeymapItem );
|
||||||
// Saved keymaps
|
// Saved keymaps
|
||||||
mapsBox->AddChild( new BScrollView( "userScrollList", fUserListView,
|
mapsBox->AddChild( new BScrollView( "userScrollList", fUserListView,
|
||||||
@@ -422,7 +422,7 @@ MapView::MapView(BRect rect, const char *name, Keymap* keymap)
|
|||||||
// TODO: Properly handle font sensitivity in drawing the keys.
|
// TODO: Properly handle font sensitivity in drawing the keys.
|
||||||
// This at least prevents the app from looking horrible until the font sensitivity for this app
|
// This at least prevents the app from looking horrible until the font sensitivity for this app
|
||||||
// can be done the Right Way.
|
// can be done the Right Way.
|
||||||
if(fCurrentFont.Size() > 14)
|
if (fCurrentFont.Size() > 14)
|
||||||
fCurrentFont.SetSize(14);
|
fCurrentFont.SetSize(14);
|
||||||
|
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
@@ -1170,7 +1170,7 @@ MapView::DrawKey(uint32 keyCode)
|
|||||||
if (!vertical) {
|
if (!vertical) {
|
||||||
int32 w1 = 4;
|
int32 w1 = 4;
|
||||||
int32 w2 = 3;
|
int32 w2 = 3;
|
||||||
if(fKeysRect[keyCode].Width() > 20) {
|
if (fKeysRect[keyCode].Width() > 20) {
|
||||||
w1 = 6;
|
w1 = 6;
|
||||||
w2 = 6;
|
w2 = 6;
|
||||||
}
|
}
|
||||||
@@ -1348,7 +1348,6 @@ MapView::MessageReceived(BMessage *msg)
|
|||||||
keyCode = i*8 + j;
|
keyCode = i*8 + j;
|
||||||
DrawKey(keyCode);
|
DrawKey(keyCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (keyCode<0)
|
if (keyCode<0)
|
||||||
@@ -1417,7 +1416,7 @@ MapView::MouseDown(BPoint point)
|
|||||||
{
|
{
|
||||||
uint32 buttons;
|
uint32 buttons;
|
||||||
GetMouse(&point, &buttons);
|
GetMouse(&point, &buttons);
|
||||||
if(buttons & B_PRIMARY_MOUSE_BUTTON) {
|
if (buttons & B_PRIMARY_MOUSE_BUTTON) {
|
||||||
fCurrentMouseKey = 0;
|
fCurrentMouseKey = 0;
|
||||||
for (int32 i=0; i<128; i++) {
|
for (int32 i=0; i<128; i++) {
|
||||||
if (fKeysRect[i].IsValid() && fKeysRect[i].Contains(point)) {
|
if (fKeysRect[i].IsValid() && fKeysRect[i].Contains(point)) {
|
||||||
|
|||||||
@@ -81,10 +81,10 @@ Media::MessageReceived(BMessage *message)
|
|||||||
fWindow->PostMessage(message);
|
fWindow->PostMessage(message);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
BApplication::MessageReceived(message);
|
BApplication::MessageReceived(message);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -98,6 +98,6 @@ main(int, char**)
|
|||||||
if (app.InitCheck() == B_OK)
|
if (app.InitCheck() == B_OK)
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,26 +86,26 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
|
|||||||
BRect iconFrame(frame);
|
BRect iconFrame(frame);
|
||||||
iconFrame.Set(iconFrame.left, iconFrame.top+1, iconFrame.left+15, iconFrame.top+16);
|
iconFrame.Set(iconFrame.left, iconFrame.top+1, iconFrame.left+15, iconFrame.top+16);
|
||||||
uint32 index = 0;
|
uint32 index = 0;
|
||||||
if(OutlineLevel()==0 || (fIsDefaultInput && fIsDefaultOutput)) {
|
if (OutlineLevel()==0 || (fIsDefaultInput && fIsDefaultOutput)) {
|
||||||
if(fIsDefaultInput && fIsVideo)
|
if (fIsDefaultInput && fIsVideo)
|
||||||
index = 4;
|
index = 4;
|
||||||
else if(fIsDefaultInput && !fIsVideo)
|
else if (fIsDefaultInput && !fIsVideo)
|
||||||
index = 2;
|
index = 2;
|
||||||
owner->SetDrawingMode(B_OP_OVER);
|
owner->SetDrawingMode(B_OP_OVER);
|
||||||
owner->DrawBitmap(static_cast<BBitmap*>(fIcons->ItemAt(index)), iconFrame);
|
owner->DrawBitmap(static_cast<BBitmap*>(fIcons->ItemAt(index)), iconFrame);
|
||||||
owner->SetDrawingMode(B_OP_COPY);
|
owner->SetDrawingMode(B_OP_COPY);
|
||||||
}
|
}
|
||||||
iconFrame.OffsetBy(16, 0);
|
iconFrame.OffsetBy(16, 0);
|
||||||
if(fIsDefaultInput || fIsDefaultOutput || fIsAudioMixer) {
|
if (fIsDefaultInput || fIsDefaultOutput || fIsAudioMixer) {
|
||||||
if(fIsAudioMixer)
|
if (fIsAudioMixer)
|
||||||
index = 1;
|
index = 1;
|
||||||
else if(fIsDefaultOutput) {
|
else if (fIsDefaultOutput) {
|
||||||
if(fIsVideo)
|
if (fIsVideo)
|
||||||
index = 5;
|
index = 5;
|
||||||
else
|
else
|
||||||
index = 3;
|
index = 3;
|
||||||
} else {
|
} else {
|
||||||
if(fIsVideo)
|
if (fIsVideo)
|
||||||
index = 4;
|
index = 4;
|
||||||
else
|
else
|
||||||
index = 2;
|
index = 2;
|
||||||
@@ -131,7 +131,7 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
|
|||||||
void
|
void
|
||||||
MediaListItem::SetDefault(bool isDefault, bool isInput)
|
MediaListItem::SetDefault(bool isDefault, bool isInput)
|
||||||
{
|
{
|
||||||
if(isInput)
|
if (isInput)
|
||||||
fIsDefaultInput = isDefault;
|
fIsDefaultInput = isDefault;
|
||||||
else
|
else
|
||||||
fIsDefaultOutput = isDefault;
|
fIsDefaultOutput = isDefault;
|
||||||
@@ -159,11 +159,11 @@ MediaListItem::Compare(const void *firstArg, const void *secondArg)
|
|||||||
{
|
{
|
||||||
const MediaListItem *item1 = *static_cast<const MediaListItem * const *>(firstArg);
|
const MediaListItem *item1 = *static_cast<const MediaListItem * const *>(firstArg);
|
||||||
const MediaListItem *item2 = *static_cast<const MediaListItem * const *>(secondArg);
|
const MediaListItem *item2 = *static_cast<const MediaListItem * const *>(secondArg);
|
||||||
if(item1->fIsVideo != item2->fIsVideo)
|
if (item1->fIsVideo != item2->fIsVideo)
|
||||||
return item1->fIsVideo ? 1 : -1;
|
return item1->fIsVideo ? 1 : -1;
|
||||||
if(item1->OutlineLevel()!=item2->OutlineLevel())
|
if (item1->OutlineLevel()!=item2->OutlineLevel())
|
||||||
return item1->OutlineLevel()>item2->OutlineLevel() ? 1 : -1;
|
return item1->OutlineLevel()>item2->OutlineLevel() ? 1 : -1;
|
||||||
if(item1->fIsAudioMixer!=item2->fIsAudioMixer)
|
if (item1->fIsAudioMixer!=item2->fIsAudioMixer)
|
||||||
return item2->fIsAudioMixer ? 1 : -1;
|
return item2->fIsAudioMixer ? 1 : -1;
|
||||||
return strcmp(item1->fLabel, item2->fLabel);
|
return strcmp(item1->fLabel, item2->fLabel);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ BarView::Draw(BRect updateRect)
|
|||||||
{
|
{
|
||||||
BRect r = Bounds();
|
BRect r = Bounds();
|
||||||
|
|
||||||
if(fDisplay) {
|
if (fDisplay) {
|
||||||
// Display the 3D Look Divider Bar
|
// Display the 3D Look Divider Bar
|
||||||
SetHighColor(140,140,140,0);
|
SetHighColor(140,140,140,0);
|
||||||
StrokeLine(BPoint(r.left,r.top),BPoint(r.right,r.top));
|
StrokeLine(BPoint(r.left,r.top),BPoint(r.right,r.top));
|
||||||
@@ -84,7 +84,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
|
|||||||
defaultsBox->AddChild(menuField2);
|
defaultsBox->AddChild(menuField2);
|
||||||
menuField2->SetDivider(divider);
|
menuField2->SetDivider(divider);
|
||||||
|
|
||||||
if(!fIsVideo) {
|
if (!fIsVideo) {
|
||||||
defaultRect.OffsetBy(186, 0);
|
defaultRect.OffsetBy(186, 0);
|
||||||
defaultRect.right -= 30;
|
defaultRect.right -= 30;
|
||||||
fMenu3 = new BPopUpMenu("<none>");
|
fMenu3 = new BPopUpMenu("<none>");
|
||||||
@@ -121,7 +121,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
|
|||||||
|
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
BMediaRoster::Roster()->GetRealtimeFlags(&flags);
|
BMediaRoster::Roster()->GetRealtimeFlags(&flags);
|
||||||
if(flags & (fIsVideo ? B_MEDIA_REALTIME_VIDEO : B_MEDIA_REALTIME_AUDIO))
|
if (flags & (fIsVideo ? B_MEDIA_REALTIME_VIDEO : B_MEDIA_REALTIME_AUDIO))
|
||||||
fRealtimeCheckBox->SetValue(B_CONTROL_ON);
|
fRealtimeCheckBox->SetValue(B_CONTROL_ON);
|
||||||
|
|
||||||
rect2.top += 26;
|
rect2.top += 26;
|
||||||
@@ -145,7 +145,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
|
|||||||
"Restart Media Services", new BMessage(ML_RESTART_MEDIA_SERVER));
|
"Restart Media Services", new BMessage(ML_RESTART_MEDIA_SERVER));
|
||||||
AddChild(restartButton);
|
AddChild(restartButton);
|
||||||
|
|
||||||
if(!fIsVideo) {
|
if (!fIsVideo) {
|
||||||
rect.right = rect.left - 10;
|
rect.right = rect.left - 10;
|
||||||
rect.top += 4;
|
rect.top += 4;
|
||||||
rect.left = frame.left + 33;
|
rect.left = frame.left + 33;
|
||||||
@@ -156,7 +156,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
|
|||||||
"Show Volume Control on Deskbar", new BMessage(ML_SHOW_VOLUME_CONTROL));
|
"Show Volume Control on Deskbar", new BMessage(ML_SHOW_VOLUME_CONTROL));
|
||||||
AddChild(fVolumeCheckBox);
|
AddChild(fVolumeCheckBox);
|
||||||
|
|
||||||
if(BDeskbar().HasItem("MediaReplicant"))
|
if (BDeskbar().HasItem("MediaReplicant"))
|
||||||
fVolumeCheckBox->SetValue(B_CONTROL_ON);
|
fVolumeCheckBox->SetValue(B_CONTROL_ON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -186,7 +186,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
|
|||||||
|
|
||||||
for (int32 i = 0; i < menu->CountItems(); i++) {
|
for (int32 i = 0; i < menu->CountItems(); i++) {
|
||||||
SettingsItem *item = static_cast<SettingsItem *>(menu->ItemAt(i));
|
SettingsItem *item = static_cast<SettingsItem *>(menu->ItemAt(i));
|
||||||
if(item->fInfo && item->fInfo->addon == info.addon && item->fInfo->flavor_id == info.flavor_id) {
|
if (item->fInfo && item->fInfo->addon == info.addon && item->fInfo->flavor_id == info.flavor_id) {
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -215,7 +215,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
|
|||||||
media_input *input = new media_input();
|
media_input *input = new media_input();
|
||||||
memcpy(input, &inputs[i], sizeof(*input));
|
memcpy(input, &inputs[i], sizeof(*input));
|
||||||
fMenu3->AddItem(item = new Settings2Item(&info, input, new BMessage(message)));
|
fMenu3->AddItem(item = new Settings2Item(&info, input, new BMessage(message)));
|
||||||
if(inputs[i].destination.id == outputID)
|
if (inputs[i].destination.id == outputID)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ const uint32 ML_DEFAULTOUTPUT_CHANGE = 'doch';
|
|||||||
class BarView : public BView
|
class BarView : public BView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BarView(BRect frame);
|
BarView(BRect frame);
|
||||||
virtual void Draw(BRect updateRect);
|
virtual void Draw(BRect updateRect);
|
||||||
bool fDisplay;
|
bool fDisplay;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SettingsItem : public BMenuItem
|
class SettingsItem : public BMenuItem
|
||||||
@@ -58,18 +58,18 @@ class Settings2Item : public BMenuItem
|
|||||||
class SettingsView : public BView
|
class SettingsView : public BView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SettingsView(BRect frame, bool isVideo);
|
SettingsView(BRect frame, bool isVideo);
|
||||||
void AddNodes(BList &list, bool isInput);
|
void AddNodes(BList &list, bool isInput);
|
||||||
void SetDefault(dormant_node_info &info, bool isInput, int32 outputID = -1);
|
void SetDefault(dormant_node_info &info, bool isInput, int32 outputID = -1);
|
||||||
BCheckBox *fRealtimeCheckBox;
|
BCheckBox *fRealtimeCheckBox;
|
||||||
BCheckBox *fVolumeCheckBox;
|
BCheckBox *fVolumeCheckBox;
|
||||||
BMenu *fMenu1;
|
BMenu *fMenu1;
|
||||||
BMenu *fMenu2;
|
BMenu *fMenu2;
|
||||||
BMenu *fMenu3;
|
BMenu *fMenu3;
|
||||||
BStringView *fRestartView;
|
BStringView *fRestartView;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool fIsVideo;
|
bool fIsVideo;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -53,17 +53,17 @@ 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();
|
||||||
if(roster && fCurrentNode)
|
if (roster && fCurrentNode)
|
||||||
roster->ReleaseNode(*fCurrentNode);
|
roster->ReleaseNode(*fCurrentNode);
|
||||||
|
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
@@ -72,10 +72,10 @@ MediaWindow::~MediaWindow()
|
|||||||
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) {
|
||||||
path.Append(SETTINGS_FILE);
|
path.Append(SETTINGS_FILE);
|
||||||
BFile file(path.Path(),B_READ_WRITE|B_CREATE_FILE|B_ERASE_FILE);
|
BFile file(path.Path(), B_READ_WRITE|B_CREATE_FILE|B_ERASE_FILE);
|
||||||
if(file.InitCheck()==B_OK) {
|
if (file.InitCheck()==B_OK) {
|
||||||
file.Write(buffer, strlen(buffer));
|
file.Write(buffer, strlen(buffer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,19 +92,19 @@ MediaWindow::FindNodes(media_type type, uint64 kind, BList &list)
|
|||||||
BMediaRoster *roster = BMediaRoster::Roster();
|
BMediaRoster *roster = BMediaRoster::Roster();
|
||||||
format.type = type;
|
format.type = type;
|
||||||
|
|
||||||
if(kind & B_PHYSICAL_OUTPUT)
|
if (kind & B_PHYSICAL_OUTPUT)
|
||||||
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();
|
||||||
@@ -119,9 +119,9 @@ 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 = static_cast<MediaListItem *>(fListView->ItemAt(j));
|
||||||
if(item->fInfo && item->fInfo->addon == info->addon && item->fInfo->flavor_id == info->flavor_id) {
|
if (item->fInfo && item->fInfo->addon == info->addon && item->fInfo->flavor_id == info->flavor_id) {
|
||||||
return item;
|
return item;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -133,9 +133,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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,10 +146,10 @@ 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, kDevicesColorSpace);
|
icon->SetBits(kDevicesBits, kDevicesWidth*kDevicesHeight, 0, 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, kMixerColorSpace);
|
icon->SetBits(kMixerBits, kMixerWidth*kMixerHeight, 0, kMixerColorSpace);
|
||||||
fIcons.AddItem(icon);
|
fIcons.AddItem(icon);
|
||||||
@@ -170,10 +170,10 @@ MediaWindow::InitWindow(void)
|
|||||||
BRect bounds = Bounds(); // the whole view
|
BRect bounds = Bounds(); // the whole view
|
||||||
|
|
||||||
// Create the OutlineView
|
// Create the OutlineView
|
||||||
BRect menuRect(bounds.left+14,bounds.top+14,bounds.left+146,bounds.bottom-14);
|
BRect menuRect(bounds.left+14, bounds.top+14, bounds.left+146, bounds.bottom-14);
|
||||||
BRect titleRect(menuRect.right+14,menuRect.top,bounds.right-10,menuRect.top+16);
|
BRect titleRect(menuRect.right+14, menuRect.top, bounds.right-10, menuRect.top+16);
|
||||||
BRect availableRect(menuRect.right+15,titleRect.bottom+12,bounds.right-14,bounds.bottom-4);
|
BRect availableRect(menuRect.right+15, titleRect.bottom+12, bounds.right-14, bounds.bottom-4);
|
||||||
BRect barRect(titleRect.left,titleRect.bottom+10,titleRect.right-2,titleRect.bottom+11);
|
BRect barRect(titleRect.left, titleRect.bottom+10, titleRect.right-2, titleRect.bottom+11);
|
||||||
|
|
||||||
fListView = new BListView(menuRect, "media_list_view", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES);
|
fListView = new BListView(menuRect, "media_list_view", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES);
|
||||||
fListView->SetSelectionMessage(new BMessage(ML_SELECTED_NODE));
|
fListView->SetSelectionMessage(new BMessage(ML_SELECTED_NODE));
|
||||||
@@ -223,15 +223,15 @@ MediaWindow::InitMedia(bool first)
|
|||||||
status_t err = B_OK;
|
status_t err = B_OK;
|
||||||
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"
|
"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 ?", "Quit", "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...\n");
|
"restart_alert", "Restarting Media Services\nStarting Media Server...\n");
|
||||||
fAlert->Show();
|
fAlert->Show();
|
||||||
|
|
||||||
@@ -243,28 +243,28 @@ MediaWindow::InitMedia(bool first)
|
|||||||
Lock();
|
Lock();
|
||||||
|
|
||||||
bool isVideoSelected = true;
|
bool isVideoSelected = true;
|
||||||
if(!first && fListView->ItemAt(0) && fListView->ItemAt(0)->IsSelected())
|
if (!first && fListView->ItemAt(0) && fListView->ItemAt(0)->IsSelected())
|
||||||
isVideoSelected = false;
|
isVideoSelected = false;
|
||||||
|
|
||||||
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...");
|
fAlert->TextView()->SetText("Ready For Use...");
|
||||||
}
|
}
|
||||||
|
|
||||||
void *listItem;
|
void *listItem;
|
||||||
while((listItem = fListView->RemoveItem((int32)0)))
|
while ((listItem = fListView->RemoveItem((int32)0)))
|
||||||
delete static_cast<MediaListItem *>(listItem);
|
delete static_cast<MediaListItem *>(listItem);
|
||||||
while((listItem = fAudioOutputs.RemoveItem((int32)0)))
|
while ((listItem = fAudioOutputs.RemoveItem((int32)0)))
|
||||||
delete static_cast<dormant_node_info *>(listItem);
|
delete static_cast<dormant_node_info *>(listItem);
|
||||||
while((listItem = fAudioInputs.RemoveItem((int32)0)))
|
while ((listItem = fAudioInputs.RemoveItem((int32)0)))
|
||||||
delete static_cast<dormant_node_info *>(listItem);
|
delete static_cast<dormant_node_info *>(listItem);
|
||||||
while((listItem = fVideoOutputs.RemoveItem((int32)0)))
|
while ((listItem = fVideoOutputs.RemoveItem((int32)0)))
|
||||||
delete static_cast<dormant_node_info *>(listItem);
|
delete static_cast<dormant_node_info *>(listItem);
|
||||||
while((listItem = fVideoInputs.RemoveItem((int32)0)))
|
while ((listItem = fVideoInputs.RemoveItem((int32)0)))
|
||||||
delete static_cast<dormant_node_info *>(listItem);
|
delete static_cast<dormant_node_info *>(listItem);
|
||||||
|
|
||||||
MediaListItem *item, *mixer, *audio, *video;
|
MediaListItem *item, *mixer, *audio, *video;
|
||||||
|
|
||||||
// Grab Media Info
|
// Grab Media Info
|
||||||
FindNodes(B_MEDIA_RAW_AUDIO, B_PHYSICAL_OUTPUT, fAudioOutputs);
|
FindNodes(B_MEDIA_RAW_AUDIO, B_PHYSICAL_OUTPUT, fAudioOutputs);
|
||||||
@@ -301,53 +301,53 @@ MediaWindow::InitMedia(bool first)
|
|||||||
int32 outputID;
|
int32 outputID;
|
||||||
BString outputName;
|
BString outputName;
|
||||||
|
|
||||||
if(roster->GetAudioInput(&default_node)==B_OK) {
|
if (roster->GetAudioInput(&default_node)==B_OK) {
|
||||||
roster->GetDormantNodeFor(default_node, &node_info);
|
roster->GetDormantNodeFor(default_node, &node_info);
|
||||||
item = FindMediaListItem(&node_info);
|
item = FindMediaListItem(&node_info);
|
||||||
if(item)
|
if (item)
|
||||||
item->SetDefault(true, true);
|
item->SetDefault(true, true);
|
||||||
fAudioView->SetDefault(node_info, true);
|
fAudioView->SetDefault(node_info, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(roster->GetAudioOutput(&default_node, &outputID, &outputName)==B_OK) {
|
if (roster->GetAudioOutput(&default_node, &outputID, &outputName)==B_OK) {
|
||||||
roster->GetDormantNodeFor(default_node, &node_info);
|
roster->GetDormantNodeFor(default_node, &node_info);
|
||||||
item = FindMediaListItem(&node_info);
|
item = FindMediaListItem(&node_info);
|
||||||
if(item)
|
if (item)
|
||||||
item->SetDefault(true, false);
|
item->SetDefault(true, false);
|
||||||
fAudioView->SetDefault(node_info, false, outputID);
|
fAudioView->SetDefault(node_info, false, outputID);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(roster->GetVideoInput(&default_node)==B_OK) {
|
if (roster->GetVideoInput(&default_node)==B_OK) {
|
||||||
roster->GetDormantNodeFor(default_node, &node_info);
|
roster->GetDormantNodeFor(default_node, &node_info);
|
||||||
item = FindMediaListItem(&node_info);
|
item = FindMediaListItem(&node_info);
|
||||||
if(item)
|
if (item)
|
||||||
item->SetDefault(true, true);
|
item->SetDefault(true, true);
|
||||||
fVideoView->SetDefault(node_info, true);
|
fVideoView->SetDefault(node_info, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(roster->GetVideoOutput(&default_node)==B_OK) {
|
if (roster->GetVideoOutput(&default_node)==B_OK) {
|
||||||
roster->GetDormantNodeFor(default_node, &node_info);
|
roster->GetDormantNodeFor(default_node, &node_info);
|
||||||
item = FindMediaListItem(&node_info);
|
item = FindMediaListItem(&node_info);
|
||||||
if(item)
|
if (item)
|
||||||
item->SetDefault(true, false);
|
item->SetDefault(true, false);
|
||||||
fVideoView->SetDefault(node_info, false);
|
fVideoView->SetDefault(node_info, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(first) {
|
if (first) {
|
||||||
fListView->Select(fListView->IndexOf(mixer));
|
fListView->Select(fListView->IndexOf(mixer));
|
||||||
} else {
|
} else {
|
||||||
if(!fAudioView->fRestartView->IsHidden())
|
if (!fAudioView->fRestartView->IsHidden())
|
||||||
fAudioView->fRestartView->Hide();
|
fAudioView->fRestartView->Hide();
|
||||||
if(!fVideoView->fRestartView->IsHidden())
|
if (!fVideoView->fRestartView->IsHidden())
|
||||||
fVideoView->fRestartView->Hide();
|
fVideoView->fRestartView->Hide();
|
||||||
|
|
||||||
if(isVideoSelected)
|
if (isVideoSelected)
|
||||||
fListView->Select(fListView->IndexOf(video));
|
fListView->Select(fListView->IndexOf(video));
|
||||||
else
|
else
|
||||||
fListView->Select(fListView->IndexOf(audio));
|
fListView->Select(fListView->IndexOf(audio));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fAlert) {
|
if (fAlert) {
|
||||||
snooze(800000);
|
snooze(800000);
|
||||||
fAlert->PostMessage(B_QUIT_REQUESTED);
|
fAlert->PostMessage(B_QUIT_REQUESTED);
|
||||||
}
|
}
|
||||||
@@ -407,15 +407,15 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
case ML_DEFAULTOUTPUT_CHANGE:
|
case ML_DEFAULTOUTPUT_CHANGE:
|
||||||
{
|
{
|
||||||
int32 index;
|
int32 index;
|
||||||
if(message->FindInt32("index", &index)!=B_OK)
|
if (message->FindInt32("index", &index)!=B_OK)
|
||||||
break;
|
break;
|
||||||
Settings2Item *item = static_cast<Settings2Item *>(fAudioView->fMenu3->ItemAt(index));
|
Settings2Item *item = static_cast<Settings2Item *>(fAudioView->fMenu3->ItemAt(index));
|
||||||
|
|
||||||
if(item) {
|
if (item) {
|
||||||
BMediaRoster *roster = BMediaRoster::Roster();
|
BMediaRoster *roster = BMediaRoster::Roster();
|
||||||
roster->SetAudioOutput(*item->fInput);
|
roster->SetAudioOutput(*item->fInput);
|
||||||
|
|
||||||
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");
|
||||||
@@ -425,27 +425,27 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
{
|
{
|
||||||
bool isVideo = true;
|
bool isVideo = true;
|
||||||
bool isInput = true;
|
bool isInput = true;
|
||||||
if(message->FindBool("isVideo", &isVideo)!=B_OK)
|
if (message->FindBool("isVideo", &isVideo)!=B_OK)
|
||||||
break;
|
break;
|
||||||
if(message->FindBool("isInput", &isInput)!=B_OK)
|
if (message->FindBool("isInput", &isInput)!=B_OK)
|
||||||
break;
|
break;
|
||||||
int32 index;
|
int32 index;
|
||||||
if(message->FindInt32("index", &index)!=B_OK)
|
if (message->FindInt32("index", &index)!=B_OK)
|
||||||
break;
|
break;
|
||||||
SettingsView *settingsView = isVideo ? fVideoView : fAudioView;
|
SettingsView *settingsView = isVideo ? fVideoView : fAudioView;
|
||||||
BMenu *menu = isInput ? settingsView->fMenu1 : settingsView->fMenu2;
|
BMenu *menu = isInput ? settingsView->fMenu1 : settingsView->fMenu2;
|
||||||
SettingsItem *item = static_cast<SettingsItem *>(menu->ItemAt(index));
|
SettingsItem *item = static_cast<SettingsItem *>(menu->ItemAt(index));
|
||||||
|
|
||||||
if(item) {
|
if (item) {
|
||||||
PRINT(("isVideo %i isInput %i\n", isVideo, isInput));
|
PRINT(("isVideo %i isInput %i\n", isVideo, isInput));
|
||||||
BMediaRoster *roster = BMediaRoster::Roster();
|
BMediaRoster *roster = BMediaRoster::Roster();
|
||||||
if(isVideo) {
|
if (isVideo) {
|
||||||
if(isInput)
|
if (isInput)
|
||||||
roster->SetVideoInput(*item->fInfo);
|
roster->SetVideoInput(*item->fInfo);
|
||||||
else
|
else
|
||||||
roster->SetVideoOutput(*item->fInfo);
|
roster->SetVideoOutput(*item->fInfo);
|
||||||
} else {
|
} else {
|
||||||
if(isInput)
|
if (isInput)
|
||||||
roster->SetAudioInput(*item->fInfo);
|
roster->SetAudioInput(*item->fInfo);
|
||||||
else {
|
else {
|
||||||
roster->SetAudioOutput(*item->fInfo);
|
roster->SetAudioOutput(*item->fInfo);
|
||||||
@@ -454,25 +454,25 @@ 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;
|
||||||
}
|
}
|
||||||
if(oldListItem)
|
if (oldListItem)
|
||||||
oldListItem->SetDefault(false, isInput);
|
oldListItem->SetDefault(false, isInput);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "oldListItem not found\n");
|
fprintf(stderr, "oldListItem not found\n");
|
||||||
|
|
||||||
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");
|
||||||
@@ -515,14 +515,14 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
case ML_ENABLE_REAL_TIME:
|
case ML_ENABLE_REAL_TIME:
|
||||||
{
|
{
|
||||||
bool isVideo = true;
|
bool isVideo = true;
|
||||||
if(message->FindBool("isVideo", &isVideo)!=B_OK)
|
if (message->FindBool("isVideo", &isVideo)!=B_OK)
|
||||||
break;
|
break;
|
||||||
SettingsView *settingsView = isVideo ? fVideoView : fAudioView;
|
SettingsView *settingsView = isVideo ? fVideoView : fAudioView;
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
uint32 realtimeFlag = isVideo ? B_MEDIA_REALTIME_VIDEO : B_MEDIA_REALTIME_AUDIO;
|
uint32 realtimeFlag = isVideo ? B_MEDIA_REALTIME_VIDEO : B_MEDIA_REALTIME_AUDIO;
|
||||||
BMediaRoster *roster = BMediaRoster::Roster();
|
BMediaRoster *roster = BMediaRoster::Roster();
|
||||||
roster->GetRealtimeFlags(&flags);
|
roster->GetRealtimeFlags(&flags);
|
||||||
if(settingsView->fRealtimeCheckBox->Value()==B_CONTROL_ON)
|
if (settingsView->fRealtimeCheckBox->Value()==B_CONTROL_ON)
|
||||||
flags |= realtimeFlag;
|
flags |= realtimeFlag;
|
||||||
else
|
else
|
||||||
flags &= ~realtimeFlag;
|
flags &= ~realtimeFlag;
|
||||||
@@ -535,44 +535,43 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
PRINT_OBJECT(*message);
|
PRINT_OBJECT(*message);
|
||||||
|
|
||||||
MediaListItem *item = static_cast<MediaListItem *>(fListView->ItemAt(fListView->CurrentSelection()));
|
MediaListItem *item = static_cast<MediaListItem *>(fListView->ItemAt(fListView->CurrentSelection()));
|
||||||
if(!item)
|
if (!item)
|
||||||
break;
|
break;
|
||||||
BMediaRoster* roster = BMediaRoster::Roster();
|
BMediaRoster* roster = BMediaRoster::Roster();
|
||||||
if(fCurrentNode) {
|
if (fCurrentNode) {
|
||||||
// stop watching the MediaRoster
|
// stop watching the MediaRoster
|
||||||
roster->StopWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
|
roster->StopWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
|
||||||
roster->ReleaseNode(*fCurrentNode);
|
roster->ReleaseNode(*fCurrentNode);
|
||||||
}
|
}
|
||||||
fCurrentNode = NULL;
|
fCurrentNode = NULL;
|
||||||
BView *paramView = fContentView->ChildAt(0);
|
BView *paramView = fContentView->ChildAt(0);
|
||||||
if(paramView!=NULL) {
|
if (paramView!=NULL) {
|
||||||
fContentView->RemoveChild(paramView);
|
fContentView->RemoveChild(paramView);
|
||||||
}
|
}
|
||||||
paramView = NULL;
|
paramView = NULL;
|
||||||
if(fParamWeb)
|
if (fParamWeb)
|
||||||
delete fParamWeb;
|
delete fParamWeb;
|
||||||
fParamWeb = NULL;
|
fParamWeb = NULL;
|
||||||
|
|
||||||
fTitleView->SetText(item->GetLabel());
|
fTitleView->SetText(item->GetLabel());
|
||||||
|
|
||||||
if(item->OutlineLevel() == 0) {
|
if (item->OutlineLevel() == 0) {
|
||||||
if(item->IsVideo())
|
if (item->IsVideo())
|
||||||
fContentView->AddChild(fVideoView);
|
fContentView->AddChild(fVideoView);
|
||||||
else
|
else
|
||||||
fContentView->AddChild(fAudioView);
|
fContentView->AddChild(fAudioView);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(!fCurrentNode)
|
if (!fCurrentNode)
|
||||||
fCurrentNode = new media_node();
|
fCurrentNode = new media_node();
|
||||||
media_node_id node_id;
|
media_node_id node_id;
|
||||||
if(item->IsAudioMixer())
|
if (item->IsAudioMixer())
|
||||||
roster->GetAudioMixer(fCurrentNode);
|
roster->GetAudioMixer(fCurrentNode);
|
||||||
else if(roster->GetInstancesFor(item->fInfo->addon, item->fInfo->flavor_id, &node_id)!=B_OK)
|
else if (roster->GetInstancesFor(item->fInfo->addon, item->fInfo->flavor_id, &node_id)!=B_OK)
|
||||||
roster->InstantiateDormantNode(*(item->fInfo), fCurrentNode, B_FLAVOR_IS_GLOBAL);
|
roster->InstantiateDormantNode(*(item->fInfo), fCurrentNode, B_FLAVOR_IS_GLOBAL);
|
||||||
else
|
else
|
||||||
roster->GetNodeFor(node_id, fCurrentNode);
|
roster->GetNodeFor(node_id, fCurrentNode);
|
||||||
|
|
||||||
|
|
||||||
if (roster->GetParameterWebFor(*fCurrentNode, &fParamWeb)==B_OK
|
if (roster->GetParameterWebFor(*fCurrentNode, &fParamWeb)==B_OK
|
||||||
&& (paramView = BMediaTheme::PreferredTheme()->ViewFor(fParamWeb)) != NULL) {
|
&& (paramView = BMediaTheme::PreferredTheme()->ViewFor(fParamWeb)) != NULL) {
|
||||||
fContentView->AddChild(paramView);
|
fContentView->AddChild(paramView);
|
||||||
@@ -594,7 +593,7 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool barChanged = (item->OutlineLevel() == 0 || fParamWeb == NULL || fParamWeb->CountGroups()<2);
|
bool barChanged = (item->OutlineLevel() == 0 || fParamWeb == NULL || fParamWeb->CountGroups()<2);
|
||||||
if(barChanged != fBar->fDisplay) {
|
if (barChanged != fBar->fDisplay) {
|
||||||
fBar->fDisplay = barChanged;
|
fBar->fDisplay = barChanged;
|
||||||
fBar->Invalidate();
|
fBar->Invalidate();
|
||||||
}
|
}
|
||||||
@@ -604,7 +603,7 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
{
|
{
|
||||||
PRINT_OBJECT(*message);
|
PRINT_OBJECT(*message);
|
||||||
const char *mimeSig;
|
const char *mimeSig;
|
||||||
if(fAlert && message->FindString("be:signature", &mimeSig)==B_OK
|
if (fAlert && message->FindString("be:signature", &mimeSig)==B_OK
|
||||||
&& (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();
|
||||||
@@ -617,11 +616,11 @@ MediaWindow::MessageReceived (BMessage *message)
|
|||||||
{
|
{
|
||||||
PRINT_OBJECT(*message);
|
PRINT_OBJECT(*message);
|
||||||
const char *mimeSig;
|
const char *mimeSig;
|
||||||
if(message->FindString("be:signature", &mimeSig)==B_OK) {
|
if (message->FindString("be:signature", &mimeSig)==B_OK) {
|
||||||
if(strcmp(mimeSig, "application/x-vnd.Be.addon-host")==0
|
if (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) {
|
||||||
BMediaRoster* roster = BMediaRoster::CurrentRoster();
|
BMediaRoster* roster = BMediaRoster::CurrentRoster();
|
||||||
if(roster&&roster->Lock())
|
if (roster&&roster->Lock())
|
||||||
roster->Quit();
|
roster->Quit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -638,7 +637,7 @@ status_t
|
|||||||
MediaWindow::RestartMediaServices(void *data)
|
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", "Restarting Media Services\nShutting down Media Server\n");
|
||||||
|
|
||||||
window->fAlert->Show();
|
window->fAlert->Show();
|
||||||
@@ -647,7 +646,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...");
|
window->fAlert->TextView()->SetText("Starting Media Server...");
|
||||||
}
|
}
|
||||||
launch_media_server();
|
launch_media_server();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
class MediaWindow : public BWindow
|
class MediaWindow : public BWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MediaWindow(BRect frame);
|
MediaWindow(BRect frame);
|
||||||
~MediaWindow();
|
~MediaWindow();
|
||||||
virtual bool QuitRequested();
|
virtual bool QuitRequested();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
@@ -49,14 +49,14 @@ class MediaWindow : public BWindow
|
|||||||
|
|
||||||
BBox * fBox;
|
BBox * fBox;
|
||||||
BListView* fListView;
|
BListView* fListView;
|
||||||
BStringView* fTitleView;
|
BStringView* fTitleView;
|
||||||
BView* fContentView;
|
BView* fContentView;
|
||||||
SettingsView* fAudioView;
|
SettingsView* fAudioView;
|
||||||
SettingsView* fVideoView;
|
SettingsView* fVideoView;
|
||||||
BarView* fBar;
|
BarView* fBar;
|
||||||
|
|
||||||
media_node* fCurrentNode;
|
media_node* fCurrentNode;
|
||||||
BParameterWeb* fParamWeb;
|
BParameterWeb* fParamWeb;
|
||||||
|
|
||||||
BList fAudioInputs;
|
BList fAudioInputs;
|
||||||
BList fAudioOutputs;
|
BList fAudioOutputs;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Media",
|
short_info = "Media",
|
||||||
long_info = "Media ©2003-2006 Haiku"
|
long_info = "Media ©2003-2006 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Menu",
|
short_info = "Menu",
|
||||||
long_info = "Menu ©2002-2007 Haiku"
|
long_info = "Menu ©2002-2007 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource(1, "BEOS:FILE_TYPES") message;
|
resource(1, "BEOS:FILE_TYPES") message;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "Screen",
|
short_info = "Screen",
|
||||||
long_info = "Screen ©2001-2006 Haiku"
|
long_info = "Screen ©2001-2006 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
#ifdef HAIKU_TARGET_PLATFORM_HAIKU
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ class ScreenSaverApp : public BApplication {
|
|||||||
ScreenSaverApp::ScreenSaverApp()
|
ScreenSaverApp::ScreenSaverApp()
|
||||||
: BApplication("application/x-vnd.Haiku-ScreenSaver")
|
: BApplication("application/x-vnd.Haiku-ScreenSaver")
|
||||||
{
|
{
|
||||||
fScreenSaverWindow = new ScreenSaverWindow();
|
fScreenSaverWindow = new ScreenSaverWindow();
|
||||||
fScreenSaverWindow->Show();
|
fScreenSaverWindow->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ ModulesView::_OpenSaver()
|
|||||||
{
|
{
|
||||||
// create new screen saver preview & config
|
// create new screen saver preview & config
|
||||||
|
|
||||||
BView* view = fPreviewView->AddPreview();
|
BView* view = fPreviewView->AddPreview();
|
||||||
fCurrentName = fSettings.ModuleName();
|
fCurrentName = fSettings.ModuleName();
|
||||||
fSaverRunner = new ScreenSaverRunner(Window(), view, true, fSettings);
|
fSaverRunner = new ScreenSaverRunner(Window(), view, true, fSettings);
|
||||||
BScreenSaver* saver = _ScreenSaver();
|
BScreenSaver* saver = _ScreenSaver();
|
||||||
@@ -890,7 +890,7 @@ ScreenSaverWindow::MessageReceived(BMessage *msg)
|
|||||||
default:
|
default:
|
||||||
BWindow::MessageReceived(msg);
|
BWindow::MessageReceived(msg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ HEventList::SetType(const char* type)
|
|||||||
|
|
||||||
BString name;
|
BString name;
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
while(mfiles.GetNextRef(&name,&ref) == B_OK) {
|
while (mfiles.GetNextRef(&name,&ref) == B_OK) {
|
||||||
BPath path(&ref);
|
BPath path(&ref);
|
||||||
AddItem(new HEventItem(name.String(), path.Path()));
|
AddItem(new HEventItem(name.String(), path.Path()));
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ void
|
|||||||
HEventList::RemoveAll()
|
HEventList::RemoveAll()
|
||||||
{
|
{
|
||||||
BListItem *item;
|
BListItem *item;
|
||||||
while((item = RemoveItem((int32)0))!=NULL)
|
while ((item = RemoveItem((int32)0))!=NULL)
|
||||||
delete item;
|
delete item;
|
||||||
MakeEmpty();
|
MakeEmpty();
|
||||||
}
|
}
|
||||||
@@ -92,17 +92,16 @@ HEventList::SelectionChanged()
|
|||||||
BListView::SelectionChanged();
|
BListView::SelectionChanged();
|
||||||
|
|
||||||
int32 sel = CurrentSelection();
|
int32 sel = CurrentSelection();
|
||||||
if(sel >= 0)
|
if (sel >= 0) {
|
||||||
{
|
|
||||||
HEventItem *item = cast_as(ItemAt(sel),HEventItem);
|
HEventItem *item = cast_as(ItemAt(sel),HEventItem);
|
||||||
if(!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
BMediaFiles().GetRefFor(fType, item->Name(), &ref);
|
BMediaFiles().GetRefFor(fType, item->Name(), &ref);
|
||||||
|
|
||||||
BPath path(&ref);
|
BPath path(&ref);
|
||||||
if((path.InitCheck()==B_OK) || (ref.name == NULL) || (strcmp(ref.name, "")==0)) {
|
if ((path.InitCheck()==B_OK) || (ref.name == NULL) || (strcmp(ref.name, "")==0)) {
|
||||||
item->SetPath(path.Path());
|
item->SetPath(path.Path());
|
||||||
InvalidateItem(sel);
|
InvalidateItem(sel);
|
||||||
} else {
|
} else {
|
||||||
@@ -126,9 +125,9 @@ void
|
|||||||
HEventList::SetPath(const char* path)
|
HEventList::SetPath(const char* path)
|
||||||
{
|
{
|
||||||
int32 sel = CurrentSelection();
|
int32 sel = CurrentSelection();
|
||||||
if(sel >= 0) {
|
if (sel >= 0) {
|
||||||
HEventItem *item = cast_as(ItemAt(sel),HEventItem);
|
HEventItem *item = cast_as(ItemAt(sel),HEventItem);
|
||||||
if(!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
|
|||||||
@@ -182,16 +182,16 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
BMenu *menu = menufield->Menu();
|
BMenu *menu = menufield->Menu();
|
||||||
|
|
||||||
int32 sel = fEventList->CurrentSelection();
|
int32 sel = fEventList->CurrentSelection();
|
||||||
if(sel >= 0) {
|
if (sel >= 0) {
|
||||||
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
|
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
|
||||||
BPath path(item->Path());
|
BPath path(item->Path());
|
||||||
if(path.InitCheck() != B_OK) {
|
if (path.InitCheck() != B_OK) {
|
||||||
BMenuItem *item = menu->FindItem("<none>");
|
BMenuItem *item = menu->FindItem("<none>");
|
||||||
if(item)
|
if (item)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
} else{
|
} else{
|
||||||
BMenuItem *item = menu->FindItem(path.Leaf());
|
BMenuItem *item = menu->FindItem(path.Leaf());
|
||||||
if(item)
|
if (item)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -203,7 +203,7 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
{
|
{
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
int32 sel = fEventList->CurrentSelection();
|
int32 sel = fEventList->CurrentSelection();
|
||||||
if(message->FindRef("refs", &ref) == B_OK && sel >= 0) {
|
if (message->FindRef("refs", &ref) == B_OK && sel >= 0) {
|
||||||
BMenuField *menufield = cast_as(FindView("filemenu"), BMenuField);
|
BMenuField *menufield = cast_as(FindView("filemenu"), BMenuField);
|
||||||
BMenu *menu = menufield->Menu();
|
BMenu *menu = menufield->Menu();
|
||||||
// check audio file
|
// check audio file
|
||||||
@@ -225,12 +225,12 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
BPath path(&ref);
|
BPath path(&ref);
|
||||||
msg->AddRef("refs", &ref);
|
msg->AddRef("refs", &ref);
|
||||||
BMenuItem *menuitem = menu->FindItem(path.Leaf());
|
BMenuItem *menuitem = menu->FindItem(path.Leaf());
|
||||||
if(!menuitem)
|
if (!menuitem)
|
||||||
menu->AddItem(menuitem = new BMenuItem(path.Leaf(), msg), 0);
|
menu->AddItem(menuitem = new BMenuItem(path.Leaf(), msg), 0);
|
||||||
// refresh item
|
// refresh item
|
||||||
fEventList->SetPath(BPath(&ref).Path());
|
fEventList->SetPath(BPath(&ref).Path());
|
||||||
// check file menu
|
// check file menu
|
||||||
if(menuitem)
|
if (menuitem)
|
||||||
menuitem->SetMarked(true);
|
menuitem->SetMarked(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -238,11 +238,11 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
case M_PLAY_MESSAGE:
|
case M_PLAY_MESSAGE:
|
||||||
{
|
{
|
||||||
int32 sel = fEventList->CurrentSelection();
|
int32 sel = fEventList->CurrentSelection();
|
||||||
if(sel >= 0)
|
if (sel >= 0)
|
||||||
{
|
{
|
||||||
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
|
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
|
||||||
const char* path = item->Path();
|
const char* path = item->Path();
|
||||||
if(path)
|
if (path)
|
||||||
{
|
{
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
::get_ref_for_path(path, &ref);
|
::get_ref_for_path(path, &ref);
|
||||||
@@ -255,9 +255,9 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
}
|
}
|
||||||
case M_STOP_MESSAGE:
|
case M_STOP_MESSAGE:
|
||||||
{
|
{
|
||||||
if(!fPlayer)
|
if (!fPlayer)
|
||||||
break;
|
break;
|
||||||
if(fPlayer->IsPlaying())
|
if (fPlayer->IsPlaying())
|
||||||
{
|
{
|
||||||
fPlayer->StopPlaying();
|
fPlayer->StopPlaying();
|
||||||
delete fPlayer;
|
delete fPlayer;
|
||||||
@@ -271,15 +271,15 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
BMenuField *menufield = cast_as(FindView("filemenu"), BMenuField);
|
BMenuField *menufield = cast_as(FindView("filemenu"), BMenuField);
|
||||||
BMenu *menu = menufield->Menu();
|
BMenu *menu = menufield->Menu();
|
||||||
|
|
||||||
if(message->FindString("path", &path) == B_OK) {
|
if (message->FindString("path", &path) == B_OK) {
|
||||||
BPath path(path);
|
BPath path(path);
|
||||||
if(path.InitCheck() != B_OK) {
|
if (path.InitCheck() != B_OK) {
|
||||||
BMenuItem *item = menu->FindItem("<none>");
|
BMenuItem *item = menu->FindItem("<none>");
|
||||||
if(item)
|
if (item)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
} else {
|
} else {
|
||||||
BMenuItem *item = menu->FindItem(path.Leaf());
|
BMenuItem *item = menu->FindItem(path.Leaf());
|
||||||
if(item)
|
if (item)
|
||||||
item->SetMarked(true);
|
item->SetMarked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ HWindow::MessageReceived(BMessage *message)
|
|||||||
case M_ITEM_MESSAGE:
|
case M_ITEM_MESSAGE:
|
||||||
{
|
{
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if(message->FindRef("refs", &ref) == B_OK) {
|
if (message->FindRef("refs", &ref) == B_OK) {
|
||||||
fEventList->SetPath(BPath(&ref).Path());
|
fEventList->SetPath(BPath(&ref).Path());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -314,13 +314,13 @@ HWindow::SetupMenuField()
|
|||||||
int32 count = fEventList->CountItems();
|
int32 count = fEventList->CountItems();
|
||||||
for(int32 i = 0; i < count; i++) {
|
for(int32 i = 0; i < count; i++) {
|
||||||
HEventItem *item = cast_as(fEventList->ItemAt(i), HEventItem);
|
HEventItem *item = cast_as(fEventList->ItemAt(i), HEventItem);
|
||||||
if(!item)
|
if (!item)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BPath path(item->Path());
|
BPath path(item->Path());
|
||||||
if(path.InitCheck() != B_OK)
|
if (path.InitCheck() != B_OK)
|
||||||
continue;
|
continue;
|
||||||
if(menu->FindItem(path.Leaf()))
|
if (menu->FindItem(path.Leaf()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
BMessage *msg = new BMessage(M_ITEM_MESSAGE);
|
BMessage *msg = new BMessage(M_ITEM_MESSAGE);
|
||||||
@@ -408,10 +408,10 @@ HWindow::Pulse()
|
|||||||
BButton *button = cast_as(FindView("play"), BButton);
|
BButton *button = cast_as(FindView("play"), BButton);
|
||||||
BButton *stop = cast_as(FindView("stop"), BButton);
|
BButton *stop = cast_as(FindView("stop"), BButton);
|
||||||
|
|
||||||
if(!menufield)
|
if (!menufield)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(sel >=0) {
|
if (sel >=0) {
|
||||||
menufield->SetEnabled(true);
|
menufield->SetEnabled(true);
|
||||||
|
|
||||||
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
|
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
|
||||||
@@ -424,8 +424,8 @@ HWindow::Pulse()
|
|||||||
menufield->SetEnabled(false);
|
menufield->SetEnabled(false);
|
||||||
button->SetEnabled(false);
|
button->SetEnabled(false);
|
||||||
}
|
}
|
||||||
if(fPlayer) {
|
if (fPlayer) {
|
||||||
if(fPlayer->IsPlaying())
|
if (fPlayer->IsPlaying())
|
||||||
stop->SetEnabled(true);
|
stop->SetEnabled(true);
|
||||||
else
|
else
|
||||||
stop->SetEnabled(false);
|
stop->SetEnabled(false);
|
||||||
@@ -440,7 +440,7 @@ HWindow::Pulse()
|
|||||||
void
|
void
|
||||||
HWindow::DispatchMessage(BMessage *message, BHandler *handler)
|
HWindow::DispatchMessage(BMessage *message, BHandler *handler)
|
||||||
{
|
{
|
||||||
if(message->what == B_PULSE)
|
if (message->what == B_PULSE)
|
||||||
Pulse();
|
Pulse();
|
||||||
BWindow::DispatchMessage(message, handler);
|
BWindow::DispatchMessage(message, handler);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ SubDir HAIKU_TOP src preferences sounds ;
|
|||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
|
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
|
||||||
SubDirC++Flags -fmultiple-symbol-spaces ;
|
SubDirC++Flags -fmultiple-symbol-spaces ;
|
||||||
}
|
}
|
||||||
|
|
||||||
Preference Sounds :
|
Preference Sounds :
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ resource app_version {
|
|||||||
internal = 0,
|
internal = 0,
|
||||||
|
|
||||||
short_info = "VirtualMemory",
|
short_info = "VirtualMemory",
|
||||||
long_info = "VirtualMemory ©2005-2007 Haiku"
|
long_info = "VirtualMemory ©2005-2007 Haiku"
|
||||||
};
|
};
|
||||||
|
|
||||||
resource app_flags B_SINGLE_LAUNCH;
|
resource app_flags B_SINGLE_LAUNCH;
|
||||||
|
|||||||
Reference in New Issue
Block a user