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:
Jérôme Duval 2008-01-13 23:05:30 +00:00
parent 69666c9199
commit 269fdeefff
35 changed files with 382 additions and 385 deletions

View File

@ -13,7 +13,7 @@ resource app_version {
internal = 0,
short_info = "Appearance",
long_info = "Appearance ©2002-2007 Haiku"
long_info = "Appearance ©2002-2007 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;

View File

@ -313,8 +313,8 @@ BackgroundImage::Show(BackgroundImageInfo *info, BView *view)
followFlags, tile);
view->Invalidate();
/*if(fShowingBitmap != info) {
if(fShowingBitmap)
/*if (fShowingBitmap != info) {
if (fShowingBitmap)
fShowingBitmap->UnloadBitmap(fCacheMode);
fShowingBitmap = info;
}*/
@ -484,8 +484,8 @@ BackgroundImage::Refresh(BackgroundImage *oldBackgroundImage,
void
BackgroundImage::ChangeImageSet(BPoseView *poseView)
{
if(fRandomChange) {
if(fImageSetCount > 1) {
if (fRandomChange) {
if (fImageSetCount > 1) {
uint32 oldShowingImageSet = fShowingImageSet;
while(oldShowingImageSet == fShowingImageSet)
fShowingImageSet = random()%fImageSetCount;
@ -493,7 +493,7 @@ BackgroundImage::ChangeImageSet(BPoseView *poseView)
fShowingImageSet = 0;
} else {
fShowingImageSet++;
if(fShowingImageSet > fImageSetCount - 1)
if (fShowingImageSet > fImageSetCount - 1)
fShowingImageSet = 0;
}

View File

@ -13,7 +13,7 @@ resource app_version {
internal = 0,
short_info = "Backgrounds",
long_info = "Backgrounds ©2002-2006 Haiku"
long_info = "Backgrounds ©2002-2006 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;

View File

@ -66,12 +66,12 @@ RangeConfItem::~RangeConfItem()
/***********************************************************
* DrawItem
***********************************************************/
void
void
RangeConfItem::DrawItem(BView *owner, BRect itemRect, bool complete)
{
rgb_color kBlack = { 0,0,0,0 };
rgb_color kHighlight = { 156,154,156,0 };
if (IsSelected() || complete) {
rgb_color color;
if (IsSelected())
@ -83,7 +83,6 @@ RangeConfItem::DrawItem(BView *owner, BRect itemRect, bool complete)
owner->SetLowColor(color);
owner->FillRect(itemRect);
owner->SetHighColor(kBlack);
} else {
owner->SetLowColor(owner->ViewColor());
}
@ -98,8 +97,8 @@ RangeConfItem::DrawItem(BView *owner, BRect itemRect, bool complete)
owner->MovePenTo(point);
char string[20];
if (fLowAddress >= 0) {
if (fLowAddress >= 0) {
sprintf(string, "0x%04lx", fLowAddress);
owner->DrawString(string);
}
@ -111,8 +110,8 @@ RangeConfItem::DrawItem(BView *owner, BRect itemRect, bool complete)
point += BPoint(15, 0);
owner->MovePenTo(point);
owner->SetFont(be_plain_font);
if (fHighAddress >= 0) {
if (fHighAddress >= 0) {
sprintf(string, "0x%04lx", fHighAddress);
owner->DrawString(string);
}
@ -141,10 +140,10 @@ RangeConfItem::Compare(const void *firstArg, const void *secondArg)
ConfigurationWindow::ConfigurationWindow(BRect frame, DeviceItem *item)
: BWindow (frame, item->GetInfo()->GetCardName(), B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL ,
B_NOT_MINIMIZABLE | B_NOT_ZOOMABLE|B_NOT_RESIZABLE),
fItem(item)
fItem(item)
{
CenterWindowOnScreen(this);
fItem->SetWindow(this);
fItem->SetWindow(this);
InitWindow();
Show();
@ -173,12 +172,12 @@ ConfigurationWindow::InitWindow(void)
BRect rtab = Bounds();
BRect rlist = Bounds();
rtab.top += 10;
rlist.top += 11;
rlist.left += 13;
rlist.right -= 13;
rlist.bottom -= 44;
// Create the TabView and Tabs
rlist.top += 11;
rlist.left += 13;
rlist.right -= 13;
rlist.bottom -= 44;
// Create the TabView and Tabs
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@ -188,8 +187,8 @@ ConfigurationWindow::InitWindow(void)
// Create the Views
BBox *resources = new BBox(rlist, "resources",
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
BMenuItem *menuItem;
fConfigurationMenu = new BPopUpMenu("<empty>");
fConfigurationMenu->AddItem(menuItem = new BMenuItem("Current Configuration",
@ -263,12 +262,12 @@ ConfigurationWindow::InitWindow(void)
fDMAMenu[0]->Superitem()->SetLabel("");
fDMAMenu[1]->Superitem()->SetLabel("");
fDMAMenu[2]->Superitem()->SetLabel("");
BRect boxRect = resources->Bounds();
boxRect.top = 74;
boxRect.left += 13;
boxRect.right -= 11;
boxRect.bottom = boxRect.top + 141;
boxRect.left += 13;
boxRect.right -= 11;
boxRect.bottom = boxRect.top + 141;
BBox *ioPortBox = new BBox(boxRect, "ioPort",
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
ioPortBox->SetLabel(new BStringView(BRect(0,0,150,15), "ioPortLabel", " IO Port Ranges "));
@ -348,7 +347,7 @@ ConfigurationWindow::InitWindow(void)
for (int32 i=0;i<num;i++) {
get_nth_resource_descriptor_of_type(current, i, B_IO_PORT_RESOURCE,
&r, sizeof(resource_descriptor));
ioListView->AddItem(new RangeConfItem(r.d.r.minbase,
r.d.r.minbase + r.d.r.len - 1));
}
@ -363,7 +362,7 @@ ConfigurationWindow::InitWindow(void)
for (int32 i=0;i<num;i++) {
get_nth_resource_descriptor_of_type(current, i, B_MEMORY_RESOURCE,
&r, sizeof(resource_descriptor));
memoryListView->AddItem(new RangeConfItem(r.d.r.minbase,
r.d.r.minbase + r.d.r.len - 1));
}
@ -374,7 +373,7 @@ ConfigurationWindow::InitWindow(void)
BBox *info = new BBox(rlist, "info",
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW, B_NO_BORDER);
bool isISAPnP = false;
BString compatibleIDString;
@ -384,14 +383,14 @@ ConfigurationWindow::InitWindow(void)
&& (((id >> 16) & 0xff) == 'n')
&& (((id >> 8) & 0xff) == 'P')) {
isISAPnP = true;
char string[255];
sprintf(string, "Compatible ID #%ld:",
devicesInfo->GetInfo()->id[3]);
compatibleIDString = string;
}
}
BRect labelRect(1, 10, 132, 30);
BStringView *label = new BStringView(labelRect, "Card Name", "Card Name:");
label->SetAlignment(B_ALIGN_RIGHT);
@ -429,7 +428,7 @@ ConfigurationWindow::InitWindow(void)
label = new BStringView(labelRect, "Compatible ID#", compatibleIDString.String());
label->SetAlignment(B_ALIGN_RIGHT);
info->AddChild(label);
}
}
labelRect.OffsetBy(0, 18);
label = new BStringView(labelRect, "Current State", "Current State:");
label->SetAlignment(B_ALIGN_RIGHT);
@ -469,7 +468,7 @@ ConfigurationWindow::InitWindow(void)
BString logicalString;
switch (devicesInfo->GetInfo()->bus) {
case B_ISA_BUS:
case B_ISA_BUS:
{
char string[255];
if (isISAPnP) {
@ -483,7 +482,7 @@ ConfigurationWindow::InitWindow(void)
(uint8)(id >> 28) & 0xf,
(uint8)((id >> 24) & 0xf));
vendor = string;
sprintf(string, "%08lx", devicesInfo->GetInfo()->id[2]);
cardID = string;
@ -509,7 +508,7 @@ ConfigurationWindow::InitWindow(void)
(uint8)(id >> 16) & 0xf,
(uint8)(id >> 20) & 0xf,
(uint8)((id >> 24) & 0xff));
vendor = string;
vendor = string;
cardID = "0";
}
@ -537,7 +536,7 @@ ConfigurationWindow::InitWindow(void)
break;
}
}
}
}
break;
case B_PCMCIA_BUS: vendor = "XX"; break;
default: vendor = "<Unknown>"; break;
@ -590,7 +589,7 @@ ConfigurationWindow::InitWindow(void)
label = new BStringView(labelRect, "Resource Conflicts", resourceConflicts.String());
info->AddChild(label);
BTab *tab = new BTab();
tabView->AddTab(resources, tab);
tab->SetLabel("Resources");
@ -624,7 +623,7 @@ bool
ConfigurationWindow::QuitRequested()
{
fItem->SetWindow(NULL);
return true;
return true;
}
// ---------------------------------------------------------------------------------------------------------- //

View File

@ -24,8 +24,8 @@
class Devices : public BApplication
{
public:
Devices();
virtual void MessageReceived(BMessage *message);
Devices();
virtual void MessageReceived(BMessage *message);
private:
@ -47,20 +47,21 @@ void Devices::MessageReceived (BMessage *message)
{
switch(message->what)
{
default:
BApplication::MessageReceived(message); // pass it along ...
break;
}
default:
BApplication::MessageReceived(message); // pass it along ...
break;
}
}
// ---------------------------------------------------------------------------------------------------------- //
// Devices Main
int main(void)
int
main(void)
{
Devices theApp;
theApp.Run();
return 0;
Devices theApp;
theApp.Run();
return 0;
}
// end ------------------------------------------------------------------------------------------------------ //

View File

@ -14,7 +14,7 @@ resource app_version
internal = 0,
short_info = "Devices",
long_info = "Devices ©2002-2007 Haiku"
long_info = "Devices ©2002-2007 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;

View File

@ -202,7 +202,7 @@ DeviceItem::DrawItem(BView *owner, BRect itemRect, bool complete)
owner->MovePenTo(point);
owner->DrawString(fName);
if(fInfo) {
if (fInfo) {
point += BPoint(222, 0);
BString string = "enabled";
if (!(fInfo->GetInfo()->flags & B_DEVICE_INFO_ENABLED))

View File

@ -23,10 +23,10 @@
class DevicesInfo
{
public:
DevicesInfo(struct device_info *info,
struct device_configuration *current,
struct possible_device_configurations *possible);
~DevicesInfo();
DevicesInfo(struct device_info *info,
struct device_configuration *current,
struct possible_device_configurations *possible);
~DevicesInfo();
struct device_info * GetInfo() { return fInfo;}
char * GetDeviceName() const { return fDeviceName; }
char * GetCardName() const { return fCardName; }

View File

@ -69,25 +69,25 @@ DevicesWindow::DevicesWindow(BRect frame) : BWindow (frame, "Devices", B_TITLED_
CenterWindowOnScreen(this);
// Load User Settings
BPath path;
find_directory(B_USER_SETTINGS_DIRECTORY,&path);
path.Append("Devices_Settings",true);
BFile file(path.Path(),B_READ_ONLY);
BMessage msg;
msg.Unflatten(&file);
LoadSettings (&msg);
status_t error;
BPath path;
find_directory(B_USER_SETTINGS_DIRECTORY,&path);
path.Append("Devices_Settings",true);
BFile file(path.Path(),B_READ_ONLY);
BMessage msg;
msg.Unflatten(&file);
LoadSettings (&msg);
status_t error;
if ((error = init_cm_wrapper()) < 0) {
printf("Error initializing configuration manager (%s)\n", strerror(error));
exit(1);
}
InitDevices(B_ISA_BUS);
InitDevices(B_PCI_BUS);
for (int32 i=fList.CountItems()-1; i>=0; i--) {
InitDevices(B_ISA_BUS);
InitDevices(B_PCI_BUS);
for (int32 i=fList.CountItems()-1; i>=0; i--) {
DevicesInfo *deviceInfo = (DevicesInfo *) fList.ItemAt(i);
struct device_info *info = deviceInfo->GetInfo();
BListItem *item = systemMenu;
@ -253,7 +253,7 @@ bool DevicesWindow::QuitRequested()
{
SaveSettings();
be_app->PostMessage(B_QUIT_REQUESTED);
return true;
return true;
}
// ---------------------------------------------------------------------------------------------------------- //
@ -277,12 +277,12 @@ void DevicesWindow::SaveSettings(void)
BMessage msg;
msg.AddRect("windowframe",Frame());
BPath path;
status_t result = find_directory(B_USER_SETTINGS_DIRECTORY,&path);
if (result == B_OK)
{
BPath path;
status_t result = find_directory(B_USER_SETTINGS_DIRECTORY,&path);
if (result == B_OK)
{
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);
}
}

View File

@ -35,10 +35,10 @@ void CenterWindowOnScreen(BWindow* w);
class ResourceUsageWindow : public BWindow {
public:
ResourceUsageWindow(BRect frame, BList &);
~ResourceUsageWindow();
virtual void MessageReceived(BMessage *message);
ResourceUsageWindow(BRect frame, BList &);
~ResourceUsageWindow();
virtual void MessageReceived(BMessage *message);
private:
void InitWindow(BList &);
};
@ -46,19 +46,19 @@ class ResourceUsageWindow : public BWindow {
class ModemWindow : public BWindow {
public:
ModemWindow(BRect frame, BMessenger);
~ModemWindow();
virtual void MessageReceived(BMessage *message);
ModemWindow(BRect frame, BMessenger);
~ModemWindow();
virtual void MessageReceived(BMessage *message);
private:
void InitWindow(void);
BMessenger fMessenger;
BMessenger fMessenger;
};
class ConfigurationWindow : public BWindow {
public:
ConfigurationWindow(BRect frame, DeviceItem *item);
~ConfigurationWindow();
virtual bool QuitRequested();
~ConfigurationWindow();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
private:
void InitWindow(void);
@ -74,9 +74,9 @@ class ConfigurationWindow : public BWindow {
class DevicesWindow : public BWindow {
public:
DevicesWindow(BRect frame);
~DevicesWindow();
virtual bool QuitRequested();
DevicesWindow(BRect frame);
~DevicesWindow();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
private:
void InitWindow(void);
@ -89,19 +89,19 @@ class DevicesWindow : public BWindow {
ResourceUsageWindow* ptrResourceUsageWindow;
ModemWindow* ptrModemWindow;
BStringView *stvDeviceName;
BStringView *stvCurrentState;
BMenuBar *menubar;
BList fList;
BListItem *systemMenu, *isaMenu, *pciMenu, *jumperedMenu;
BOutlineListView *outline;
BStringView *stvIRQ;
BStringView *stvDeviceName;
BStringView *stvCurrentState;
BMenuBar *menubar;
BList fList;
BListItem *systemMenu, *isaMenu, *pciMenu, *jumperedMenu;
BOutlineListView *outline;
BStringView *stvIRQ;
BStringView *stvDMA;
BStringView *stvIORanges;
BStringView *stvMemoryRanges;
BButton *btnConfigure;
BButton *btnConfigure;
};
#endif

View File

@ -52,12 +52,12 @@ IRQDMAItem::~IRQDMAItem()
/***********************************************************
* DrawItem
***********************************************************/
void
void
IRQDMAItem::DrawItem(BView *owner, BRect itemRect, bool complete)
{
rgb_color kBlack = { 0,0,0,0 };
rgb_color kHighlight = { 156,154,156,0 };
if (IsSelected() || complete) {
rgb_color color;
if (IsSelected())
@ -122,12 +122,12 @@ RangeItem::~RangeItem()
/***********************************************************
* DrawItem
***********************************************************/
void
void
RangeItem::DrawItem(BView *owner, BRect itemRect, bool complete)
{
rgb_color kBlack = { 0,0,0,0 };
rgb_color kHighlight = { 156,154,156,0 };
if (IsSelected() || complete) {
rgb_color color;
if (IsSelected())
@ -208,12 +208,12 @@ void ResourceUsageWindow::InitWindow(BList &list)
BRect rtab = Bounds();
BRect rlist = Bounds();
rtab.top += 10;
rlist.top += 10;
rlist.left += 12;
rlist.right -= 15 + B_V_SCROLL_BAR_WIDTH;
rlist.bottom -= 47;
// Create the TabView and Tabs
rlist.top += 10;
rlist.left += 12;
rlist.right -= 15 + B_V_SCROLL_BAR_WIDTH;
rlist.bottom -= 47;
// Create the TabView and Tabs
BTabView *tabView = new BTabView(rtab,"resource_usage_tabview");
tabView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
@ -229,7 +229,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
BListView *memoryListView = new BListView(rlist, "memoryListView", B_SINGLE_SELECTION_LIST,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
BScrollView *IRQScrollView = new BScrollView("scroll_list1", IRQListView, B_FOLLOW_LEFT|B_FOLLOW_TOP,
0, false, true, B_FANCY_BORDER);
BScrollView *DMAScrollView = new BScrollView("scroll_list2", DMAListView, B_FOLLOW_LEFT|B_FOLLOW_TOP,
@ -251,18 +251,18 @@ void ResourceUsageWindow::InitWindow(BList &list)
tab = new BTab();
tabView->AddTab(memoryScrollView, tab);
tab->SetLabel("Memory Range");
{
uint32 mask = 1;
for (int i=0;i<16;mask<<=1,i++) {
bool first = true;
for (int32 j=0; j<list.CountItems(); j++) {
DevicesInfo *deviceInfo = (DevicesInfo *)list.ItemAt(j);
struct device_configuration *current = deviceInfo->GetCurrent();
resource_descriptor r;
int32 num = count_resource_descriptors_of_type(current, B_IRQ_RESOURCE);
for (int32 k=0;k<num;k++) {
@ -270,7 +270,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
&r, sizeof(resource_descriptor));
if (mask & r.d.m.mask) {
IRQListView->AddItem(new IRQDMAItem(first ? i : -1, deviceInfo->GetCardName()));
IRQListView->AddItem(new IRQDMAItem(first ? i : -1, deviceInfo->GetCardName()));
first = false;
}
}
@ -287,12 +287,12 @@ void ResourceUsageWindow::InitWindow(BList &list)
for (int i=0;i<8;mask<<=1,i++) {
bool first = true;
for (int32 j=0; j<list.CountItems(); j++) {
DevicesInfo *deviceInfo = (DevicesInfo *)list.ItemAt(j);
struct device_configuration *current = deviceInfo->GetCurrent();
resource_descriptor r;
int32 num = count_resource_descriptors_of_type(current, B_DMA_RESOURCE);
for (int32 k=0;k<num;k++) {
@ -300,7 +300,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
&r, sizeof(resource_descriptor));
if (mask & r.d.m.mask) {
DMAListView->AddItem(new IRQDMAItem(first ? i : -1, deviceInfo->GetCardName()));
DMAListView->AddItem(new IRQDMAItem(first ? i : -1, deviceInfo->GetCardName()));
first = false;
}
}
@ -317,7 +317,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
DevicesInfo *deviceInfo = (DevicesInfo *)list.ItemAt(j);
struct device_configuration *current = deviceInfo->GetCurrent();
resource_descriptor r;
int32 num = count_resource_descriptors_of_type(current, B_IO_PORT_RESOURCE);
for (int32 k=0;k<num;k++) {
@ -337,7 +337,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
DevicesInfo *deviceInfo = (DevicesInfo *)list.ItemAt(j);
struct device_configuration *current = deviceInfo->GetCurrent();
resource_descriptor r;
int32 num = count_resource_descriptors_of_type(current, B_MEMORY_RESOURCE);
for (int32 k=0;k<num;k++) {

View File

@ -104,7 +104,7 @@ status_t get_possible_configurations_for(uint64 id,
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;

View File

@ -13,7 +13,7 @@ resource app_version {
internal = 0,
short_info = "DriveSetup",
long_info = "DriveSetup ©2002-2007 Haiku"
long_info = "DriveSetup ©2002-2007 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;

View File

@ -179,8 +179,8 @@ bool
MainWindow::QuitRequested()
{
// TODO: ask about any unsaved changes
be_app->PostMessage(B_QUIT_REQUESTED);
Hide();
be_app->PostMessage(B_QUIT_REQUESTED);
Hide();
return false;
}

View File

@ -15,7 +15,7 @@ resource app_version {
internal = 0,
short_info = "Keyboard",
long_info = "Keyboard ©2004-2007 Haiku"
long_info = "Keyboard ©2004-2007 Haiku"
};
#ifdef HAIKU_TARGET_PLATFORM_HAIKU

View File

@ -36,12 +36,12 @@ KeyboardSettings::KeyboardSettings()
fCorner.y = 100;
status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path);
if(status == B_OK) {
if (status == B_OK) {
status = path.Append(kb_settings_file);
if(status == B_OK) {
if (status == B_OK) {
status = file.SetTo(path.Path(), B_READ_ONLY);
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.y = 100;
}

View File

@ -23,7 +23,7 @@
KeyboardWindow::KeyboardWindow()
: BWindow(BRect(0, 0, 200, 200), "Keyboard", B_TITLED_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS)
{
{
MoveTo(fSettings.WindowCorner());
// center window if it would be off-screen
@ -50,7 +50,7 @@ KeyboardWindow::KeyboardWindow()
button->SetEnabled(fSettings.IsDefaultable());
#ifdef DEBUG
fSettings.Dump();
fSettings.Dump();
#endif
Show();
@ -63,7 +63,7 @@ KeyboardWindow::QuitRequested()
fSettings.SetWindowCorner(Frame().LeftTop());
#ifdef DEBUG
fSettings.Dump();
fSettings.Dump();
#endif
be_app->PostMessage(B_QUIT_REQUESTED);
@ -105,11 +105,11 @@ KeyboardWindow::MessageReceived(BMessage* message)
slider = (BSlider *)FindView("key_repeat_rate");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatRate());
slider->SetValue(fSettings.KeyboardRepeatRate());
slider = (BSlider *)FindView("delay_until_key_repeat");
if (slider !=NULL)
slider->SetValue(fSettings.KeyboardRepeatDelay());
slider->SetValue(fSettings.KeyboardRepeatDelay());
button = (BButton *)FindView("keyboard_defaults");
if (button !=NULL)
@ -119,7 +119,7 @@ KeyboardWindow::MessageReceived(BMessage* message)
if (button !=NULL)
button->SetEnabled(false);
break;
}
}
case SLIDER_REPEAT_RATE:
{
int32 rate;
@ -133,7 +133,7 @@ KeyboardWindow::MessageReceived(BMessage* message)
button = (BButton *)FindView("keyboard_revert");
if (button !=NULL)
button->SetEnabled(true);
button->SetEnabled(true);
break;
}
case SLIDER_DELAY_RATE:
@ -165,10 +165,10 @@ KeyboardWindow::MessageReceived(BMessage* message)
button->SetEnabled(fSettings.IsDefaultable());
button = (BButton *)FindView("keyboard_revert");
if (button !=NULL)
button->SetEnabled(true);
if (button !=NULL)
button->SetEnabled(true);
break;
}
}
default:
BWindow::MessageReceived(message);

View File

@ -21,34 +21,34 @@
#include <input_globals.h>
static void
print_key( char *chars, int32 offset )
print_key(char *chars, int32 offset)
{
int size = chars[offset++];
switch( size ) {
switch(size) {
case 0:
// Not mapped
printf( "N/A" );
printf("N/A");
break;
case 1:
// 1-byte UTF-8/ASCII character
printf( "%c", chars[offset] );
printf("%c", chars[offset]);
break;
default:
// 2-, 3-, or 4-byte UTF-8 character
{
char *str = new char[size + 1];
strncpy( str, &(chars[offset]), size );
strncpy(str, &(chars[offset]), size);
str[size] = 0;
printf( "%s", str );
printf("%s", str);
delete [] str;
}
break;
}
printf( "\t" );
printf("\t");
}
@ -57,19 +57,19 @@ Keymap::DumpKeymap()
{
// Print a chart of the normal, shift, option, and option+shift
// keys.
printf( "Key #\tNormal\tShift\tCaps\tC+S\tOption\tO+S\tO+C\tO+C+S\tControl\n" );
for( int idx = 0; idx < 128; idx++ ) {
printf( " 0x%x\t", idx );
print_key( fChars, fKeys.normal_map[idx] );
print_key( fChars, fKeys.shift_map[idx] );
print_key( fChars, fKeys.caps_map[idx] );
print_key( fChars, fKeys.caps_shift_map[idx] );
print_key( fChars, fKeys.option_map[idx] );
print_key( fChars, fKeys.option_shift_map[idx] );
print_key( fChars, fKeys.option_caps_map[idx] );
print_key( fChars, fKeys.option_caps_shift_map[idx] );
print_key( fChars, fKeys.control_map[idx] );
printf( "\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++) {
printf(" 0x%x\t", idx );
print_key(fChars, fKeys.normal_map[idx]);
print_key(fChars, fKeys.shift_map[idx]);
print_key(fChars, fKeys.caps_map[idx]);
print_key(fChars, fKeys.caps_shift_map[idx]);
print_key(fChars, fKeys.option_map[idx]);
print_key(fChars, fKeys.option_shift_map[idx]);
print_key(fChars, fKeys.option_caps_map[idx]);
print_key(fChars, fKeys.option_caps_shift_map[idx]);
print_key(fChars, fKeys.control_map[idx]);
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) {
*numBytes = fChars[dead_key[i+1]];
switch( *numBytes ) {
switch(*numBytes) {
case 0:
// Not mapped
*chars = NULL;

View File

@ -13,7 +13,7 @@ resource app_version {
internal = 0,
short_info = "Keymap",
long_info = "Keymap ©2004-2006 Haiku"
long_info = "Keymap ©2004-2006 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;

View File

@ -92,7 +92,7 @@ KeymapWindow::KeymapWindow()
entry_ref ref;
get_ref_for_path(path.Path(), &ref);
fOpenPanel = new BFilePanel(B_OPEN_PANEL, new BMessenger(this), &ref,
B_FILE_NODE, false, NULL);
fSavePanel = new BFilePanel(B_SAVE_PANEL, new BMessenger(this), &ref,
@ -156,7 +156,7 @@ KeymapWindow::AddMenuBar()
menubar->AddItem( menu );
// Create the Font menu
fFontMenu = new BMenu( "Font" );
fFontMenu = new BMenu("Font");
fFontMenu->SetRadioMode(true);
int32 numFamilies = count_font_families();
font_family family, current_family;
@ -164,16 +164,16 @@ KeymapWindow::AddMenuBar()
uint32 flags;
be_plain_font->GetFamilyAndStyle(&current_family, &current_style);
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 =
new BMenuItem(family, new BMessage( MENU_FONT_CHANGED));
fFontMenu->AddItem(item);
if(strcmp(family, current_family) == 0)
if (strcmp(family, current_family) == 0)
item->SetMarked(true);
}
menubar->AddItem( fFontMenu );
menubar->AddItem(fFontMenu);
return menubar;
}
@ -207,13 +207,13 @@ KeymapWindow::AddMaps(BView *placeholderView)
fUserListView = new BListView( bounds, "userList" );
// '(Current)'
KeymapListItem *currentKeymapItem = (KeymapListItem*)fUserListView->FirstItem();
if( currentKeymapItem != NULL )
if (currentKeymapItem != NULL)
fUserListView->AddItem( currentKeymapItem );
// Saved keymaps
mapsBox->AddChild( new BScrollView( "userScrollList", fUserListView,
B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true ));
fUserListView->SetSelectionMessage( new BMessage( USER_MAP_SELECTED ));
FillSystemMaps();
FillUserMaps();
@ -245,7 +245,7 @@ KeymapWindow::MessageReceived( BMessage* message )
fMapView->Invalidate();
fSystemListView->DeselectAll();
fUserListView->DeselectAll();
}
}
break;
case B_SAVE_REQUESTED:
{
@ -261,7 +261,7 @@ KeymapWindow::MessageReceived( BMessage* message )
FillUserMaps();
}
}
}
break;
case MENU_FILE_OPEN:
fOpenPanel->Show();
@ -285,7 +285,7 @@ KeymapWindow::MessageReceived( BMessage* message )
if (item) {
fMapView->SetFontFamily(item->Label());
fMapView->Invalidate();
}
}
}
break;
case SYSTEM_MAP_SELECTED:
@ -302,13 +302,13 @@ KeymapWindow::MessageReceived( BMessage* message )
}
break;
case USER_MAP_SELECTED:
{
{
KeymapListItem *keymapListItem =
(KeymapListItem*)fUserListView->ItemAt(fUserListView->CurrentSelection());
if (keymapListItem) {
fCurrentMap.Load(keymapListItem->KeymapEntry());
fMapView->Invalidate();
// Deselect item in other BListView
fSystemListView->DeselectAll();
}
@ -319,7 +319,7 @@ KeymapWindow::MessageReceived( BMessage* message )
break;
case REVERT: // do nothing, just like the original
break;
default:
default:
BWindow::MessageReceived( message );
break;
}
@ -362,7 +362,7 @@ KeymapWindow::FillSystemMaps()
path.Append("Keymap");
BDirectory directory;
BDirectory directory;
entry_ref ref;
if (directory.SetTo(path.Path()) == B_OK)
@ -387,7 +387,7 @@ KeymapWindow::FillUserMaps()
entry_ref ref;
get_ref_for_path(path.Path(), &ref);
fUserListView->AddItem(new KeymapListItem(ref, "(Current)"));
if (find_directory(B_USER_SETTINGS_DIRECTORY, &path)!=B_OK)
@ -422,7 +422,7 @@ MapView::MapView(BRect rect, const char *name, Keymap* keymap)
// 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
// can be done the Right Way.
if(fCurrentFont.Size() > 14)
if (fCurrentFont.Size() > 14)
fCurrentFont.SetSize(14);
SetViewColor(B_TRANSPARENT_COLOR);
@ -894,7 +894,7 @@ MapView::MapView(BRect rect, const char *name, Keymap* keymap)
for (uint32 j = 0; j<128; j++)
fKeysVertical[j] = false;
fKeysVertical[0x5e] = true;
fActiveDeadKey = 0;
@ -1061,7 +1061,7 @@ MapView::DrawLocks()
FillRect(lightRect.InsetByCopy(1,1));
SetHighColor(64,64,64);
DrawString("num", BPoint(lightRect.left-2, 65), &delta);
lightRect.OffsetBy(26,0);
SetHighColor(80,80,80);
StrokeLine(lightRect.LeftBottom(), lightRect.RightBottom());
@ -1147,13 +1147,13 @@ MapView::DrawKey(uint32 keyCode)
SetHighColor(255,255,255);
StrokeRect(r);
rgb_color color6 = {96,96,96};
rgb_color color6 = {96,96,96};
AddLine(r.LeftBottom(), r.RightBottom(), color6);
rgb_color color5 = {160,160,160};
rgb_color color5 = {160,160,160};
AddLine(r.LeftBottom(), r.LeftBottom(), color5);
rgb_color color7 = {64,64,64};
AddLine(r.RightBottom(), BPoint(r.right, r.bottom-1), color7);
AddLine(BPoint(r.right, r.bottom-1), BPoint(r.right, r.top-1), color6);
AddLine(BPoint(r.right, r.bottom-1), BPoint(r.right, r.top-1), color6);
AddLine(BPoint(r.right, r.top-1), r.RightTop(), color5);
rgb_color color8 = {255,255,255};
AddLine(BPoint(r.left+1, r.bottom-1), BPoint(r.left+2, r.bottom-1), color8);
@ -1166,16 +1166,16 @@ MapView::DrawKey(uint32 keyCode)
r.InsetBySelf(1,1);
r.bottom -= 1;
BRect fillRect = r;
if (!vertical) {
int32 w1 = 4;
int32 w2 = 3;
if(fKeysRect[keyCode].Width() > 20) {
if (fKeysRect[keyCode].Width() > 20) {
w1 = 6;
w2 = 6;
}
fillRect.right = fillRect.left + w1;
fillRect.right = fillRect.left + w1;
SetHighColor(152,152,152);
FillRect(fillRect);
fillRect.left += w1;
@ -1276,7 +1276,7 @@ MapView::DrawKey(uint32 keyCode)
SetDrawingMode(B_OP_OVER);
}
delete str;
}
}
}
@ -1329,7 +1329,7 @@ MapView::MessageReceived(BMessage *msg)
if ((msg->FindData("states", B_UINT8_TYPE, (const void **)&states, &size)!=B_OK)
|| (msg->FindInt32("modifiers", (int32 *)&info.modifiers)!=B_OK))
break;
if (fOldKeyInfo.modifiers != info.modifiers) {
fOldKeyInfo.modifiers = info.modifiers;
for (int8 i=0; i<16; i++)
@ -1337,7 +1337,7 @@ MapView::MessageReceived(BMessage *msg)
InvalidateKeys();
DrawLocks();
} else {
int32 keyCode = -1;
for (int8 i=0; i<16; i++)
if (fOldKeyInfo.key_states[i] != states[i]) {
@ -1348,7 +1348,6 @@ MapView::MessageReceived(BMessage *msg)
keyCode = i*8 + j;
DrawKey(keyCode);
}
}
if (keyCode<0)
@ -1361,10 +1360,10 @@ MapView::MessageReceived(BMessage *msg)
i = 16;
break;
}
}
}
}
if (Window()->IsActive()
&& msg->what == B_KEY_DOWN) {
fTextView->MakeFocus();
@ -1377,7 +1376,7 @@ MapView::MessageReceived(BMessage *msg)
}
fActiveDeadKey = 0;
InvalidateKeys();
} else {
} else {
fCurrentMap->GetChars(keyCode, fOldKeyInfo.modifiers, fActiveDeadKey, &str, &numBytes);
fActiveDeadKey = fCurrentMap->IsDeadKey(keyCode, fOldKeyInfo.modifiers);
if (fActiveDeadKey)
@ -1387,7 +1386,7 @@ MapView::MessageReceived(BMessage *msg)
}
}
delete str;
}
}
}
break;
}
@ -1417,7 +1416,7 @@ MapView::MouseDown(BPoint point)
{
uint32 buttons;
GetMouse(&point, &buttons);
if(buttons & B_PRIMARY_MOUSE_BUTTON) {
if (buttons & B_PRIMARY_MOUSE_BUTTON) {
fCurrentMouseKey = 0;
for (int32 i=0; i<128; i++) {
if (fKeysRect[i].IsValid() && fKeysRect[i].Contains(point)) {

View File

@ -46,7 +46,7 @@ Media::Media()
rect.bottom = d;
}
}
}
}
}
}
@ -81,10 +81,10 @@ Media::MessageReceived(BMessage *message)
fWindow->PostMessage(message);
break;
default:
BApplication::MessageReceived(message);
break;
}
default:
BApplication::MessageReceived(message);
break;
}
}
@ -98,6 +98,6 @@ main(int, char**)
if (app.InitCheck() == B_OK)
app.Run();
return 0;
return 0;
}

View File

@ -86,26 +86,26 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
BRect iconFrame(frame);
iconFrame.Set(iconFrame.left, iconFrame.top+1, iconFrame.left+15, iconFrame.top+16);
uint32 index = 0;
if(OutlineLevel()==0 || (fIsDefaultInput && fIsDefaultOutput)) {
if(fIsDefaultInput && fIsVideo)
if (OutlineLevel()==0 || (fIsDefaultInput && fIsDefaultOutput)) {
if (fIsDefaultInput && fIsVideo)
index = 4;
else if(fIsDefaultInput && !fIsVideo)
else if (fIsDefaultInput && !fIsVideo)
index = 2;
owner->SetDrawingMode(B_OP_OVER);
owner->DrawBitmap(static_cast<BBitmap*>(fIcons->ItemAt(index)), iconFrame);
owner->SetDrawingMode(B_OP_COPY);
}
iconFrame.OffsetBy(16, 0);
if(fIsDefaultInput || fIsDefaultOutput || fIsAudioMixer) {
if(fIsAudioMixer)
if (fIsDefaultInput || fIsDefaultOutput || fIsAudioMixer) {
if (fIsAudioMixer)
index = 1;
else if(fIsDefaultOutput) {
if(fIsVideo)
else if (fIsDefaultOutput) {
if (fIsVideo)
index = 5;
else
index = 3;
} else {
if(fIsVideo)
if (fIsVideo)
index = 4;
else
index = 2;
@ -131,7 +131,7 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
void
MediaListItem::SetDefault(bool isDefault, bool isInput)
{
if(isInput)
if (isInput)
fIsDefaultInput = isDefault;
else
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 *item2 = *static_cast<const MediaListItem * const *>(secondArg);
if(item1->fIsVideo != item2->fIsVideo)
if (item1->fIsVideo != item2->fIsVideo)
return item1->fIsVideo ? 1 : -1;
if(item1->OutlineLevel()!=item2->OutlineLevel())
if (item1->OutlineLevel()!=item2->OutlineLevel())
return item1->OutlineLevel()>item2->OutlineLevel() ? 1 : -1;
if(item1->fIsAudioMixer!=item2->fIsAudioMixer)
if (item1->fIsAudioMixer!=item2->fIsAudioMixer)
return item2->fIsAudioMixer ? 1 : -1;
return strcmp(item1->fLabel, item2->fLabel);
}

View File

@ -39,7 +39,7 @@ BarView::Draw(BRect updateRect)
{
BRect r = Bounds();
if(fDisplay) {
if (fDisplay) {
// Display the 3D Look Divider Bar
SetHighColor(140,140,140,0);
StrokeLine(BPoint(r.left,r.top),BPoint(r.right,r.top));
@ -84,7 +84,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
defaultsBox->AddChild(menuField2);
menuField2->SetDivider(divider);
if(!fIsVideo) {
if (!fIsVideo) {
defaultRect.OffsetBy(186, 0);
defaultRect.right -= 30;
fMenu3 = new BPopUpMenu("<none>");
@ -121,7 +121,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
uint32 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);
rect2.top += 26;
@ -145,7 +145,7 @@ SettingsView::SettingsView (BRect frame, bool isVideo)
"Restart Media Services", new BMessage(ML_RESTART_MEDIA_SERVER));
AddChild(restartButton);
if(!fIsVideo) {
if (!fIsVideo) {
rect.right = rect.left - 10;
rect.top += 4;
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));
AddChild(fVolumeCheckBox);
if(BDeskbar().HasItem("MediaReplicant"))
if (BDeskbar().HasItem("MediaReplicant"))
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++) {
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);
break;
}
@ -215,7 +215,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
media_input *input = new media_input();
memcpy(input, &inputs[i], sizeof(*input));
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);
}
}

View File

@ -30,9 +30,9 @@ const uint32 ML_DEFAULTOUTPUT_CHANGE = 'doch';
class BarView : public BView
{
public:
BarView(BRect frame);
virtual void Draw(BRect updateRect);
bool fDisplay;
BarView(BRect frame);
virtual void Draw(BRect updateRect);
bool fDisplay;
};
class SettingsItem : public BMenuItem
@ -58,18 +58,18 @@ class Settings2Item : public BMenuItem
class SettingsView : public BView
{
public:
SettingsView(BRect frame, bool isVideo);
void AddNodes(BList &list, bool isInput);
void SetDefault(dormant_node_info &info, bool isInput, int32 outputID = -1);
BCheckBox *fRealtimeCheckBox;
BCheckBox *fVolumeCheckBox;
BMenu *fMenu1;
BMenu *fMenu2;
BMenu *fMenu3;
BStringView *fRestartView;
SettingsView(BRect frame, bool isVideo);
void AddNodes(BList &list, bool isInput);
void SetDefault(dormant_node_info &info, bool isInput, int32 outputID = -1);
BCheckBox *fRealtimeCheckBox;
BCheckBox *fVolumeCheckBox;
BMenu *fMenu1;
BMenu *fMenu2;
BMenu *fMenu3;
BStringView *fRestartView;
private:
bool fIsVideo;
private:
bool fIsVideo;
};
#endif

View File

@ -53,29 +53,29 @@ MediaWindow::InitCheck()
// MediaWindow - Destructor
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));
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));
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));
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));
BMediaRoster *roster = BMediaRoster::Roster();
if(roster && fCurrentNode)
if (roster && fCurrentNode)
roster->ReleaseNode(*fCurrentNode);
char buffer[512];
BRect rect = Frame();
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));
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);
BFile file(path.Path(),B_READ_WRITE|B_CREATE_FILE|B_ERASE_FILE);
if(file.InitCheck()==B_OK) {
BFile file(path.Path(), B_READ_WRITE|B_CREATE_FILE|B_ERASE_FILE);
if (file.InitCheck()==B_OK) {
file.Write(buffer, strlen(buffer));
}
}
@ -92,19 +92,19 @@ MediaWindow::FindNodes(media_type type, uint64 kind, BList &list)
BMediaRoster *roster = BMediaRoster::Roster();
format.type = type;
if(kind & B_PHYSICAL_OUTPUT)
if (kind & B_PHYSICAL_OUTPUT)
format1 = &format;
else if(kind & B_PHYSICAL_INPUT)
else if (kind & B_PHYSICAL_INPUT)
format2 = &format;
else
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");
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",
node_info[i].name, node_info[i].addon, node_info[i].flavor_id));
dormant_node_info *info = new dormant_node_info();
@ -119,9 +119,9 @@ MediaWindow::FindNodes(media_type type, uint64 kind, BList &list)
MediaListItem *
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));
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;
break;
}
@ -133,9 +133,9 @@ MediaWindow::FindMediaListItem(dormant_node_info *info)
void
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));
if(!FindMediaListItem(info))
if (!FindMediaListItem(info))
fListView->AddItem(new MediaListItem(info, 1, isVideo, &fIcons));
}
}
@ -144,12 +144,12 @@ MediaWindow::AddNodes(BList &list, bool isVideo)
// MediaWindow::InitWindow -- Initialization Commands here
void
MediaWindow::InitWindow(void)
{
{
// Bitmaps
BRect iconRect(0,0,15,15);
BBitmap *icon = new BBitmap(iconRect, B_CMAP8);
icon->SetBits(kDevicesBits, kDevicesWidth*kDevicesHeight, 0, kDevicesColorSpace);
fIcons.AddItem(icon);
BRect iconRect(0, 0, 15, 15);
BBitmap *icon = new BBitmap(iconRect, B_CMAP8);
icon->SetBits(kDevicesBits, kDevicesWidth*kDevicesHeight, 0, kDevicesColorSpace);
fIcons.AddItem(icon);
icon = new BBitmap(iconRect, B_CMAP8);
icon->SetBits(kMixerBits, kMixerWidth*kMixerHeight, 0, kMixerColorSpace);
fIcons.AddItem(icon);
@ -170,18 +170,18 @@ MediaWindow::InitWindow(void)
BRect bounds = Bounds(); // the whole view
// Create the OutlineView
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 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 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 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);
fListView = new BListView(menuRect, "media_list_view", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES);
fListView->SetSelectionMessage(new BMessage(ML_SELECTED_NODE));
// Add ScrollView to Media Menu
BScrollView *scrollView = new BScrollView("listscroller", fListView, B_FOLLOW_LEFT|B_FOLLOW_TOP_BOTTOM, 0, false, false, B_FANCY_BORDER);
// Create the Views
// Create the Views
fBox = new BBox(bounds, "background", B_FOLLOW_ALL_SIDES, B_WILL_DRAW | B_FRAME_EVENTS, B_PLAIN_BORDER);
// Add Child(ren)
@ -189,7 +189,7 @@ MediaWindow::InitWindow(void)
fBox->AddChild(scrollView);
// StringViews
rgb_color titleFontColor = { 0,0,0,0 };
rgb_color titleFontColor = { 0,0,0,0 };
fTitleView = new BStringView(titleRect, "AudioSettings", "Audio Settings", B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
fTitleView->SetFont(be_bold_font);
fTitleView->SetFontSize(12.0);
@ -223,48 +223,48 @@ MediaWindow::InitMedia(bool first)
status_t err = B_OK;
BMediaRoster *roster = BMediaRoster::Roster(&err);
if(first && err != B_OK) {
if (first && err != B_OK) {
BAlert *alert = new BAlert("start_media_server",
"Could not connect to the Media Server.\n"
"Would you like to start it ?", "Quit", "Start Media Server", NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
if(alert->Go()==0)
if (alert->Go()==0)
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");
fAlert->Show();
Show();
launch_media_server();
}
Lock();
bool isVideoSelected = true;
if(!first && fListView->ItemAt(0) && fListView->ItemAt(0)->IsSelected())
if (!first && fListView->ItemAt(0) && fListView->ItemAt(0)->IsSelected())
isVideoSelected = false;
if((!first || (first && err) ) && fAlert) {
if ((!first || (first && err) ) && fAlert) {
BAutolock locker(fAlert);
if(locker.IsLocked())
if (locker.IsLocked())
fAlert->TextView()->SetText("Ready For Use...");
}
void *listItem;
while((listItem = fListView->RemoveItem((int32)0)))
while ((listItem = fListView->RemoveItem((int32)0)))
delete static_cast<MediaListItem *>(listItem);
while((listItem = fAudioOutputs.RemoveItem((int32)0)))
while ((listItem = fAudioOutputs.RemoveItem((int32)0)))
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);
while((listItem = fVideoOutputs.RemoveItem((int32)0)))
while ((listItem = fVideoOutputs.RemoveItem((int32)0)))
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);
MediaListItem *item, *mixer, *audio, *video;
MediaListItem *item, *mixer, *audio, *video;
// Grab Media Info
FindNodes(B_MEDIA_RAW_AUDIO, B_PHYSICAL_OUTPUT, fAudioOutputs);
@ -292,62 +292,62 @@ MediaWindow::InitMedia(bool first)
fListView->AddItem(video = new MediaListItem("Video Settings", 0, true, &fIcons));
fListView->AddItem(mixer = new MediaListItem("Audio Mixer", 1, false, &fIcons));
mixer->SetAudioMixer(true);
mixer->SetAudioMixer(true);
fListView->SortItems(&MediaListItem::Compare);
media_node default_node;
dormant_node_info node_info;
int32 outputID;
BString outputName;
if(roster->GetAudioInput(&default_node)==B_OK) {
if (roster->GetAudioInput(&default_node)==B_OK) {
roster->GetDormantNodeFor(default_node, &node_info);
item = FindMediaListItem(&node_info);
if(item)
if (item)
item->SetDefault(true, 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);
item = FindMediaListItem(&node_info);
if(item)
if (item)
item->SetDefault(true, false);
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);
item = FindMediaListItem(&node_info);
if(item)
if (item)
item->SetDefault(true, 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);
item = FindMediaListItem(&node_info);
if(item)
if (item)
item->SetDefault(true, false);
fVideoView->SetDefault(node_info, false);
}
if(first) {
if (first) {
fListView->Select(fListView->IndexOf(mixer));
} else {
if(!fAudioView->fRestartView->IsHidden())
if (!fAudioView->fRestartView->IsHidden())
fAudioView->fRestartView->Hide();
if(!fVideoView->fRestartView->IsHidden())
if (!fVideoView->fRestartView->IsHidden())
fVideoView->fRestartView->Hide();
if(isVideoSelected)
if (isVideoSelected)
fListView->Select(fListView->IndexOf(video));
else
fListView->Select(fListView->IndexOf(audio));
}
if(fAlert) {
if (fAlert) {
snooze(800000);
fAlert->PostMessage(B_QUIT_REQUESTED);
}
@ -400,52 +400,52 @@ void
MediaWindow::MessageReceived (BMessage *message)
{
switch(message->what)
{
{
case ML_INIT_MEDIA:
InitMedia(false);
break;
case ML_DEFAULTOUTPUT_CHANGE:
{
int32 index;
if(message->FindInt32("index", &index)!=B_OK)
if (message->FindInt32("index", &index)!=B_OK)
break;
Settings2Item *item = static_cast<Settings2Item *>(fAudioView->fMenu3->ItemAt(index));
if(item) {
if (item) {
BMediaRoster *roster = BMediaRoster::Roster();
roster->SetAudioOutput(*item->fInput);
if(fAudioView->fRestartView->IsHidden())
fAudioView->fRestartView->Show();
if (fAudioView->fRestartView->IsHidden())
fAudioView->fRestartView->Show();
} else
fprintf(stderr, "Settings2Item not found\n");
}
break;
break;
case ML_DEFAULT_CHANGE:
{
bool isVideo = true;
bool isInput = true;
if(message->FindBool("isVideo", &isVideo)!=B_OK)
if (message->FindBool("isVideo", &isVideo)!=B_OK)
break;
if(message->FindBool("isInput", &isInput)!=B_OK)
if (message->FindBool("isInput", &isInput)!=B_OK)
break;
int32 index;
if(message->FindInt32("index", &index)!=B_OK)
if (message->FindInt32("index", &index)!=B_OK)
break;
SettingsView *settingsView = isVideo ? fVideoView : fAudioView;
BMenu *menu = isInput ? settingsView->fMenu1 : settingsView->fMenu2;
SettingsItem *item = static_cast<SettingsItem *>(menu->ItemAt(index));
if(item) {
if (item) {
PRINT(("isVideo %i isInput %i\n", isVideo, isInput));
BMediaRoster *roster = BMediaRoster::Roster();
if(isVideo) {
if(isInput)
if (isVideo) {
if (isInput)
roster->SetVideoInput(*item->fInfo);
else
roster->SetVideoOutput(*item->fInfo);
} else {
if(isInput)
if (isInput)
roster->SetAudioInput(*item->fInfo);
else {
roster->SetAudioOutput(*item->fInfo);
@ -454,28 +454,28 @@ MediaWindow::MessageReceived (BMessage *message)
}
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));
if(oldListItem->fInfo && oldListItem->IsVideo() == isVideo
if (oldListItem->fInfo && oldListItem->IsVideo() == isVideo
&& oldListItem->IsDefault(isInput))
break;
}
if(oldListItem)
if (oldListItem)
oldListItem->SetDefault(false, isInput);
else
fprintf(stderr, "oldListItem not found\n");
MediaListItem *listItem = FindMediaListItem(item->fInfo);
if(listItem) {
if (listItem) {
listItem->SetDefault(true, isInput);
} else
fprintf(stderr, "MediaListItem not found\n");
fListView->Invalidate();
if(settingsView->fRestartView->IsHidden())
if (settingsView->fRestartView->IsHidden())
settingsView->fRestartView->Show();
} else
fprintf(stderr, "SettingsItem not found\n");
fprintf(stderr, "SettingsItem not found\n");
}
break;
case ML_RESTART_MEDIA_SERVER:
@ -515,14 +515,14 @@ MediaWindow::MessageReceived (BMessage *message)
case ML_ENABLE_REAL_TIME:
{
bool isVideo = true;
if(message->FindBool("isVideo", &isVideo)!=B_OK)
if (message->FindBool("isVideo", &isVideo)!=B_OK)
break;
SettingsView *settingsView = isVideo ? fVideoView : fAudioView;
uint32 flags;
uint32 realtimeFlag = isVideo ? B_MEDIA_REALTIME_VIDEO : B_MEDIA_REALTIME_AUDIO;
BMediaRoster *roster = BMediaRoster::Roster();
roster->GetRealtimeFlags(&flags);
if(settingsView->fRealtimeCheckBox->Value()==B_CONTROL_ON)
if (settingsView->fRealtimeCheckBox->Value()==B_CONTROL_ON)
flags |= realtimeFlag;
else
flags &= ~realtimeFlag;
@ -535,50 +535,49 @@ MediaWindow::MessageReceived (BMessage *message)
PRINT_OBJECT(*message);
MediaListItem *item = static_cast<MediaListItem *>(fListView->ItemAt(fListView->CurrentSelection()));
if(!item)
if (!item)
break;
BMediaRoster* roster = BMediaRoster::Roster();
if(fCurrentNode) {
if (fCurrentNode) {
// stop watching the MediaRoster
roster->StopWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
roster->ReleaseNode(*fCurrentNode);
}
fCurrentNode = NULL;
BView *paramView = fContentView->ChildAt(0);
if(paramView!=NULL) {
if (paramView!=NULL) {
fContentView->RemoveChild(paramView);
}
paramView = NULL;
if(fParamWeb)
if (fParamWeb)
delete fParamWeb;
fParamWeb = NULL;
fTitleView->SetText(item->GetLabel());
if(item->OutlineLevel() == 0) {
if(item->IsVideo())
if (item->OutlineLevel() == 0) {
if (item->IsVideo())
fContentView->AddChild(fVideoView);
else
fContentView->AddChild(fAudioView);
} else {
if(!fCurrentNode)
if (!fCurrentNode)
fCurrentNode = new media_node();
media_node_id node_id;
if(item->IsAudioMixer())
if (item->IsAudioMixer())
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);
else
roster->GetNodeFor(node_id, fCurrentNode);
if (roster->GetParameterWebFor(*fCurrentNode, &fParamWeb)==B_OK
&& (paramView = BMediaTheme::PreferredTheme()->ViewFor(fParamWeb)) != NULL) {
fContentView->AddChild(paramView);
paramView->ResizeTo(fContentView->Bounds().Width(), fContentView->Bounds().Height() - 10);
roster->StartWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
roster->StartWatching(this, *fCurrentNode, B_MEDIA_WILDCARD);
} else {
if (fParamWeb)
delete fParamWeb;
@ -594,7 +593,7 @@ MediaWindow::MessageReceived (BMessage *message)
}
bool barChanged = (item->OutlineLevel() == 0 || fParamWeb == NULL || fParamWeb->CountGroups()<2);
if(barChanged != fBar->fDisplay) {
if (barChanged != fBar->fDisplay) {
fBar->fDisplay = barChanged;
fBar->Invalidate();
}
@ -604,24 +603,24 @@ MediaWindow::MessageReceived (BMessage *message)
{
PRINT_OBJECT(*message);
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.media-server")==0)) {
fAlert->Lock();
fAlert->TextView()->SetText("Starting Media Server...");
fAlert->Unlock();
}
}
}
break;
case B_SOME_APP_QUIT:
{
PRINT_OBJECT(*message);
const char *mimeSig;
if(message->FindString("be:signature", &mimeSig)==B_OK) {
if(strcmp(mimeSig, "application/x-vnd.Be.addon-host")==0
if (message->FindString("be:signature", &mimeSig)==B_OK) {
if (strcmp(mimeSig, "application/x-vnd.Be.addon-host")==0
|| strcmp(mimeSig, "application/x-vnd.Be.media-server")==0) {
BMediaRoster* roster = BMediaRoster::CurrentRoster();
if(roster&&roster->Lock())
if (roster&&roster->Lock())
roster->Quit();
}
}
@ -638,16 +637,16 @@ status_t
MediaWindow::RestartMediaServices(void *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");
window->fAlert->Show();
shutdown_media_server(B_INFINITE_TIMEOUT, MediaWindow::UpdateProgress, window->fAlert);
{
BAutolock locker(window->fAlert);
if(locker.IsLocked())
if (locker.IsLocked())
window->fAlert->TextView()->SetText("Starting Media Server...");
}
launch_media_server();

View File

@ -32,7 +32,7 @@
class MediaWindow : public BWindow
{
public:
MediaWindow(BRect frame);
MediaWindow(BRect frame);
~MediaWindow();
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
@ -49,14 +49,14 @@ class MediaWindow : public BWindow
BBox * fBox;
BListView* fListView;
BStringView* fTitleView;
BStringView* fTitleView;
BView* fContentView;
SettingsView* fAudioView;
SettingsView* fVideoView;
SettingsView* fAudioView;
SettingsView* fVideoView;
BarView* fBar;
media_node* fCurrentNode;
BParameterWeb* fParamWeb;
media_node* fCurrentNode;
BParameterWeb* fParamWeb;
BList fAudioInputs;
BList fAudioOutputs;

View File

@ -13,7 +13,7 @@ resource app_version {
internal = 0,
short_info = "Media",
long_info = "Media ©2003-2006 Haiku"
long_info = "Media ©2003-2006 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;

View File

@ -15,7 +15,7 @@ resource app_version {
internal = 0,
short_info = "Menu",
long_info = "Menu ©2002-2007 Haiku"
long_info = "Menu ©2002-2007 Haiku"
};
resource(1, "BEOS:FILE_TYPES") message;

View File

@ -15,7 +15,7 @@ resource app_version {
internal = 0,
short_info = "Screen",
long_info = "Screen ©2001-2006 Haiku"
long_info = "Screen ©2001-2006 Haiku"
};
#ifdef HAIKU_TARGET_PLATFORM_HAIKU

View File

@ -32,8 +32,8 @@ class ScreenSaverApp : public BApplication {
ScreenSaverApp::ScreenSaverApp()
: BApplication("application/x-vnd.Haiku-ScreenSaver")
{
fScreenSaverWindow = new ScreenSaverWindow();
fScreenSaverWindow->Show();
fScreenSaverWindow = new ScreenSaverWindow();
fScreenSaverWindow->Show();
}

View File

@ -488,7 +488,7 @@ ModulesView::_OpenSaver()
{
// create new screen saver preview & config
BView* view = fPreviewView->AddPreview();
BView* view = fPreviewView->AddPreview();
fCurrentName = fSettings.ModuleName();
fSaverRunner = new ScreenSaverRunner(Window(), view, true, fSettings);
BScreenSaver* saver = _ScreenSaver();
@ -890,7 +890,7 @@ ScreenSaverWindow::MessageReceived(BMessage *msg)
default:
BWindow::MessageReceived(msg);
break;
}
}
}

View File

@ -64,7 +64,7 @@ HEventList::SetType(const char* type)
BString name;
entry_ref ref;
while(mfiles.GetNextRef(&name,&ref) == B_OK) {
while (mfiles.GetNextRef(&name,&ref) == B_OK) {
BPath path(&ref);
AddItem(new HEventItem(name.String(), path.Path()));
}
@ -77,7 +77,7 @@ void
HEventList::RemoveAll()
{
BListItem *item;
while((item = RemoveItem((int32)0))!=NULL)
while ((item = RemoveItem((int32)0))!=NULL)
delete item;
MakeEmpty();
}
@ -92,17 +92,16 @@ HEventList::SelectionChanged()
BListView::SelectionChanged();
int32 sel = CurrentSelection();
if(sel >= 0)
{
if (sel >= 0) {
HEventItem *item = cast_as(ItemAt(sel),HEventItem);
if(!item)
if (!item)
return;
entry_ref ref;
BMediaFiles().GetRefFor(fType, item->Name(), &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());
InvalidateItem(sel);
} else {
@ -126,9 +125,9 @@ void
HEventList::SetPath(const char* path)
{
int32 sel = CurrentSelection();
if(sel >= 0) {
if (sel >= 0) {
HEventItem *item = cast_as(ItemAt(sel),HEventItem);
if(!item)
if (!item)
return;
entry_ref ref;

View File

@ -182,16 +182,16 @@ HWindow::MessageReceived(BMessage *message)
BMenu *menu = menufield->Menu();
int32 sel = fEventList->CurrentSelection();
if(sel >= 0) {
if (sel >= 0) {
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
BPath path(item->Path());
if(path.InitCheck() != B_OK) {
if (path.InitCheck() != B_OK) {
BMenuItem *item = menu->FindItem("<none>");
if(item)
if (item)
item->SetMarked(true);
} else{
BMenuItem *item = menu->FindItem(path.Leaf());
if(item)
if (item)
item->SetMarked(true);
}
}
@ -203,7 +203,7 @@ HWindow::MessageReceived(BMessage *message)
{
entry_ref ref;
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);
BMenu *menu = menufield->Menu();
// check audio file
@ -225,12 +225,12 @@ HWindow::MessageReceived(BMessage *message)
BPath path(&ref);
msg->AddRef("refs", &ref);
BMenuItem *menuitem = menu->FindItem(path.Leaf());
if(!menuitem)
if (!menuitem)
menu->AddItem(menuitem = new BMenuItem(path.Leaf(), msg), 0);
// refresh item
fEventList->SetPath(BPath(&ref).Path());
// check file menu
if(menuitem)
if (menuitem)
menuitem->SetMarked(true);
}
break;
@ -238,11 +238,11 @@ HWindow::MessageReceived(BMessage *message)
case M_PLAY_MESSAGE:
{
int32 sel = fEventList->CurrentSelection();
if(sel >= 0)
if (sel >= 0)
{
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
const char* path = item->Path();
if(path)
if (path)
{
entry_ref ref;
::get_ref_for_path(path, &ref);
@ -255,9 +255,9 @@ HWindow::MessageReceived(BMessage *message)
}
case M_STOP_MESSAGE:
{
if(!fPlayer)
if (!fPlayer)
break;
if(fPlayer->IsPlaying())
if (fPlayer->IsPlaying())
{
fPlayer->StopPlaying();
delete fPlayer;
@ -271,15 +271,15 @@ HWindow::MessageReceived(BMessage *message)
BMenuField *menufield = cast_as(FindView("filemenu"), BMenuField);
BMenu *menu = menufield->Menu();
if(message->FindString("path", &path) == B_OK) {
if (message->FindString("path", &path) == B_OK) {
BPath path(path);
if(path.InitCheck() != B_OK) {
if (path.InitCheck() != B_OK) {
BMenuItem *item = menu->FindItem("<none>");
if(item)
if (item)
item->SetMarked(true);
} else {
BMenuItem *item = menu->FindItem(path.Leaf());
if(item)
if (item)
item->SetMarked(true);
}
}
@ -288,7 +288,7 @@ HWindow::MessageReceived(BMessage *message)
case M_ITEM_MESSAGE:
{
entry_ref ref;
if(message->FindRef("refs", &ref) == B_OK) {
if (message->FindRef("refs", &ref) == B_OK) {
fEventList->SetPath(BPath(&ref).Path());
}
break;
@ -314,13 +314,13 @@ HWindow::SetupMenuField()
int32 count = fEventList->CountItems();
for(int32 i = 0; i < count; i++) {
HEventItem *item = cast_as(fEventList->ItemAt(i), HEventItem);
if(!item)
if (!item)
continue;
BPath path(item->Path());
if(path.InitCheck() != B_OK)
if (path.InitCheck() != B_OK)
continue;
if(menu->FindItem(path.Leaf()))
if (menu->FindItem(path.Leaf()))
continue;
BMessage *msg = new BMessage(M_ITEM_MESSAGE);
@ -408,10 +408,10 @@ HWindow::Pulse()
BButton *button = cast_as(FindView("play"), BButton);
BButton *stop = cast_as(FindView("stop"), BButton);
if(!menufield)
if (!menufield)
return;
if(sel >=0) {
if (sel >=0) {
menufield->SetEnabled(true);
HEventItem *item = cast_as(fEventList->ItemAt(sel), HEventItem);
@ -424,8 +424,8 @@ HWindow::Pulse()
menufield->SetEnabled(false);
button->SetEnabled(false);
}
if(fPlayer) {
if(fPlayer->IsPlaying())
if (fPlayer) {
if (fPlayer->IsPlaying())
stop->SetEnabled(true);
else
stop->SetEnabled(false);
@ -440,7 +440,7 @@ HWindow::Pulse()
void
HWindow::DispatchMessage(BMessage *message, BHandler *handler)
{
if(message->what == B_PULSE)
if (message->what == B_PULSE)
Pulse();
BWindow::DispatchMessage(message, handler);
}

View File

@ -3,7 +3,7 @@ SubDir HAIKU_TOP src preferences sounds ;
SetSubDirSupportedPlatformsBeOSCompatible ;
if ! $(TARGET_PLATFORM_HAIKU_COMPATIBLE) {
SubDirC++Flags -fmultiple-symbol-spaces ;
SubDirC++Flags -fmultiple-symbol-spaces ;
}
Preference Sounds :

View File

@ -13,7 +13,7 @@ resource app_version {
internal = 0,
short_info = "VirtualMemory",
long_info = "VirtualMemory ©2005-2007 Haiku"
long_info = "VirtualMemory ©2005-2007 Haiku"
};
resource app_flags B_SINGLE_LAUNCH;