Fixed all warnings and did some minor style updates (only those next to

the fixed warnings :).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6139 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2004-01-19 17:54:57 +00:00
parent e68c7d967c
commit ed8da400c3
5 changed files with 40 additions and 42 deletions
+3 -3
View File
@@ -42,12 +42,12 @@ Media::Media()
i++; i++;
} }
int32 a,b,c,d; int32 a,b,c,d;
if(sscanf(&buffer[i], " rect = %i,%i,%i,%i", &a, &b, &c, &d)>0){ if (sscanf(&buffer[i], " rect = %li,%li,%li,%li", &a, &b, &c, &d) > 0) {
if(c-a>=int(rect.Width())) { if (c-a >= rect.IntegerWidth()) {
rect.left = a; rect.left = a;
rect.right = c; rect.right = c;
} }
if(d-b>=int(rect.Height())) { if (d-b >= rect.IntegerHeight()) {
rect.top = b; rect.top = b;
rect.bottom = d; rect.bottom = d;
} }
+4 -8
View File
@@ -24,8 +24,8 @@
// MediaListItem - Constructor // MediaListItem - Constructor
MediaListItem::MediaListItem(dormant_node_info *info, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0) MediaListItem::MediaListItem(dormant_node_info *info, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0)
: BListItem(level), : BListItem(level),
mIsVideo(isVideo),
mIsAudioMixer(false), mIsAudioMixer(false),
mIsVideo(isVideo),
mIsDefaultInput(false), mIsDefaultInput(false),
mIsDefaultOutput(false) mIsDefaultOutput(false)
{ {
@@ -38,9 +38,9 @@ MediaListItem::MediaListItem(dormant_node_info *info, uint32 level, bool isVideo
MediaListItem::MediaListItem(const char *label, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0) MediaListItem::MediaListItem(const char *label, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0)
: BListItem(level), : BListItem(level),
mIsVideo(isVideo),
mLabel(label), mLabel(label),
mIsAudioMixer(false), mIsAudioMixer(false),
mIsVideo(isVideo),
mIsDefaultInput(false), mIsDefaultInput(false),
mIsDefaultOutput(false) mIsDefaultOutput(false)
{ {
@@ -62,15 +62,12 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
{ {
rgb_color kHighlight = { 140,140,140,0 }; rgb_color kHighlight = { 140,140,140,0 };
rgb_color kBlack = { 0,0,0,0 }; rgb_color kBlack = { 0,0,0,0 };
rgb_color kWhite = { 255,255,255,0 };
BRect r(frame); BRect r(frame);
if (IsSelected() || complete) if (IsSelected() || complete) {
{
rgb_color color; rgb_color color;
if (IsSelected()) if (IsSelected()) {
{
color = kHighlight; color = kHighlight;
} else { } else {
color = owner->ViewColor(); color = owner->ViewColor();
@@ -79,7 +76,6 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
owner->SetLowColor(color); owner->SetLowColor(color);
owner->FillRect(r); owner->FillRect(r);
owner->SetHighColor(kBlack); owner->SetHighColor(kBlack);
} else { } else {
owner->SetLowColor(owner->ViewColor()); owner->SetLowColor(owner->ViewColor());
} }
+7 -6
View File
@@ -12,22 +12,23 @@
// Created : June 25, 2003 // Created : June 25, 2003
// //
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
#ifndef __MEDIALISTITEM_H__ #ifndef __MEDIALISTITEM_H__
#define __MEDIALISTITEM_H__ #define __MEDIALISTITEM_H__
#include <ListItem.h> #include <ListItem.h>
#include <MediaAddOn.h> #include <MediaAddOn.h>
class MediaListItem : public BListItem
{ class MediaListItem : public BListItem {
public: public:
MediaListItem(dormant_node_info *info, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0); MediaListItem(dormant_node_info *info, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0);
MediaListItem(const char* label, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0); MediaListItem(const char* label, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0);
~MediaListItem(); ~MediaListItem();
virtual void Update(BView *owner, const BFont *finfo); virtual void Update(BView *owner, const BFont *finfo);
virtual void DrawItem(BView *owner, BRect frame, bool complete = false); virtual void DrawItem(BView *owner, BRect frame, bool complete = false);
void SetDefault(bool isDefaultInput, bool isInput); void SetDefault(bool isDefaultInput, bool isInput);
void SetAudioMixer(bool isAudioMixer); void SetAudioMixer(bool isAudioMixer);
bool IsDefault(bool isInput) { return isInput ? mIsDefaultInput : mIsDefaultOutput; } bool IsDefault(bool isInput) { return isInput ? mIsDefaultInput : mIsDefaultOutput; }
@@ -38,6 +39,7 @@ class MediaListItem : public BListItem
dormant_node_info *mInfo; dormant_node_info *mInfo;
static int Compare(const void *firstArg, const void *secondArg); static int Compare(const void *firstArg, const void *secondArg);
private: private:
const char *mLabel; const char *mLabel;
bool mIsAudioMixer; bool mIsAudioMixer;
@@ -48,5 +50,4 @@ class MediaListItem : public BListItem
BList *mIcons; BList *mIcons;
}; };
#endif /* __MEDIALISTITEM_H__ */
#endif
+3 -3
View File
@@ -161,7 +161,7 @@ SettingsView::AddNodes(BList &list, bool isInput)
{ {
BMenu *menu = isInput ? mMenu1 : mMenu2; BMenu *menu = isInput ? mMenu1 : mMenu2;
void *item; void *item;
while(item = menu->RemoveItem((int32)0)) while ((item = menu->RemoveItem((int32)0)) != NULL)
delete item; delete item;
BMessage message(ML_DEFAULT_CHANGE); BMessage message(ML_DEFAULT_CHANGE);
@@ -189,7 +189,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
if (!mIsVideo&&!isInput&&outputID>-1) { if (!mIsVideo&&!isInput&&outputID>-1) {
BMenuItem *item; BMenuItem *item;
while(item = mMenu3->RemoveItem((int32)0)) while ((item = mMenu3->RemoveItem((int32)0)) != NULL)
delete item; delete item;
BMediaRoster *roster = BMediaRoster::Roster(); BMediaRoster *roster = BMediaRoster::Roster();
media_node node; media_node node;
@@ -205,7 +205,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
int32 inputCount = 16; int32 inputCount = 16;
if (roster->GetAllInputsFor(node, inputs, 16, &inputCount)==B_OK) { if (roster->GetAllInputsFor(node, inputs, 16, &inputCount)==B_OK) {
BMessage message(ML_DEFAULTOUTPUT_CHANGE); BMessage message(ML_DEFAULTOUTPUT_CHANGE);
Settings2Item *listItem;
for (int32 i = 0; i < inputCount; i++) { for (int32 i = 0; i < inputCount; i++) {
media_input *input = new media_input(); media_input *input = new media_input();
memcpy(input, &inputs[i], sizeof(*input)); memcpy(input, &inputs[i], sizeof(*input));
+1
View File
@@ -664,3 +664,4 @@ MediaWindow::UpdateProgress(int stage, const char * message, void * cookie)
alert->TextView()->SetText(string); alert->TextView()->SetText(string);
return true; return true;
} }