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++;
}
int32 a,b,c,d;
if(sscanf(&buffer[i], " rect = %i,%i,%i,%i", &a, &b, &c, &d)>0){
if(c-a>=int(rect.Width())) {
if (sscanf(&buffer[i], " rect = %li,%li,%li,%li", &a, &b, &c, &d) > 0) {
if (c-a >= rect.IntegerWidth()) {
rect.left = a;
rect.right = c;
}
if(d-b>=int(rect.Height())) {
if (d-b >= rect.IntegerHeight()) {
rect.top = b;
rect.bottom = d;
}
+4 -8
View File
@@ -24,8 +24,8 @@
// MediaListItem - Constructor
MediaListItem::MediaListItem(dormant_node_info *info, uint32 level, bool isVideo, BList *icons, uint32 modifiers=0)
: BListItem(level),
mIsVideo(isVideo),
mIsAudioMixer(false),
mIsVideo(isVideo),
mIsDefaultInput(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)
: BListItem(level),
mIsVideo(isVideo),
mLabel(label),
mIsAudioMixer(false),
mIsVideo(isVideo),
mIsDefaultInput(false),
mIsDefaultOutput(false)
{
@@ -62,15 +62,12 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
{
rgb_color kHighlight = { 140,140,140,0 };
rgb_color kBlack = { 0,0,0,0 };
rgb_color kWhite = { 255,255,255,0 };
BRect r(frame);
if (IsSelected() || complete)
{
if (IsSelected() || complete) {
rgb_color color;
if (IsSelected())
{
if (IsSelected()) {
color = kHighlight;
} else {
color = owner->ViewColor();
@@ -79,7 +76,6 @@ MediaListItem::DrawItem(BView *owner, BRect frame, bool complete)
owner->SetLowColor(color);
owner->FillRect(r);
owner->SetHighColor(kBlack);
} else {
owner->SetLowColor(owner->ViewColor());
}
+7 -6
View File
@@ -12,22 +12,23 @@
// Created : June 25, 2003
//
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
#ifndef __MEDIALISTITEM_H__
#define __MEDIALISTITEM_H__
#include <ListItem.h>
#include <MediaAddOn.h>
class MediaListItem : public BListItem
{
class MediaListItem : public BListItem {
public:
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();
virtual void Update(BView *owner, const BFont *finfo);
virtual void DrawItem(BView *owner, BRect frame, bool complete = false);
void SetDefault(bool isDefaultInput, bool isInput);
void SetAudioMixer(bool isAudioMixer);
bool IsDefault(bool isInput) { return isInput ? mIsDefaultInput : mIsDefaultOutput; }
@@ -38,6 +39,7 @@ class MediaListItem : public BListItem
dormant_node_info *mInfo;
static int Compare(const void *firstArg, const void *secondArg);
private:
const char *mLabel;
bool mIsAudioMixer;
@@ -48,5 +50,4 @@ class MediaListItem : public BListItem
BList *mIcons;
};
#endif
#endif /* __MEDIALISTITEM_H__ */
+3 -3
View File
@@ -161,7 +161,7 @@ SettingsView::AddNodes(BList &list, bool isInput)
{
BMenu *menu = isInput ? mMenu1 : mMenu2;
void *item;
while(item = menu->RemoveItem((int32)0))
while ((item = menu->RemoveItem((int32)0)) != NULL)
delete item;
BMessage message(ML_DEFAULT_CHANGE);
@@ -189,7 +189,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
if (!mIsVideo&&!isInput&&outputID>-1) {
BMenuItem *item;
while(item = mMenu3->RemoveItem((int32)0))
while ((item = mMenu3->RemoveItem((int32)0)) != NULL)
delete item;
BMediaRoster *roster = BMediaRoster::Roster();
media_node node;
@@ -205,7 +205,7 @@ SettingsView::SetDefault(dormant_node_info &info, bool isInput, int32 outputID)
int32 inputCount = 16;
if (roster->GetAllInputsFor(node, inputs, 16, &inputCount)==B_OK) {
BMessage message(ML_DEFAULTOUTPUT_CHANGE);
Settings2Item *listItem;
for (int32 i = 0; i < inputCount; i++) {
media_input *input = new media_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);
return true;
}