From 82fbbe21aa1488316cae858ca354472f0b92a331 Mon Sep 17 00:00:00 2001 From: Pete Goodeve Date: Sun, 19 May 2013 16:51:22 -0700 Subject: [PATCH] additional style update to patchbay --- src/apps/patchbay/CountEventConsumer.h | 7 +++---- src/apps/patchbay/EndpointInfo.cpp | 8 +++----- src/apps/patchbay/EndpointInfo.h | 7 +++---- src/apps/patchbay/MidiEventMeter.cpp | 15 +++++++------- src/apps/patchbay/MidiEventMeter.h | 7 +++---- src/apps/patchbay/PatchApp.cpp | 1 + src/apps/patchbay/PatchApp.h | 7 +++---- src/apps/patchbay/PatchRow.cpp | 27 ++++++++++++++------------ src/apps/patchbay/PatchRow.h | 7 +++---- src/apps/patchbay/PatchView.cpp | 4 +++- src/apps/patchbay/PatchView.h | 8 ++++---- src/apps/patchbay/PatchWin.cpp | 1 + src/apps/patchbay/PatchWin.h | 7 +++---- 13 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/apps/patchbay/CountEventConsumer.h b/src/apps/patchbay/CountEventConsumer.h index d6fe12f100..3f8c5746c6 100644 --- a/src/apps/patchbay/CountEventConsumer.h +++ b/src/apps/patchbay/CountEventConsumer.h @@ -10,9 +10,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _CountEventConsumer_h -#define _CountEventConsumer_h +#ifndef COUNTEVENTCONSUMER_H +#define COUNTEVENTCONSUMER_H #include #include @@ -43,4 +42,4 @@ private: int32 fEventCount; }; -#endif /* _CountEventConsumer_h */ +#endif /* COUNTEVENTCONSUMER_H */ diff --git a/src/apps/patchbay/EndpointInfo.cpp b/src/apps/patchbay/EndpointInfo.cpp index 4ee9911d2a..4e4a438604 100644 --- a/src/apps/patchbay/EndpointInfo.cpp +++ b/src/apps/patchbay/EndpointInfo.cpp @@ -46,9 +46,9 @@ EndpointInfo::EndpointInfo(int32 id) fIcon(NULL) { BMidiRoster* roster = BMidiRoster::MidiRoster(); - if (roster) { + if (roster != NULL) { BMidiEndpoint* endpoint = roster->FindEndpoint(id); - if (endpoint) { + if (endpoint != NULL) { printf("endpoint %ld = %p\n", id, endpoint); BMessage msg; if (endpoint->GetProperties(&msg) == B_OK) { @@ -132,9 +132,7 @@ CreateIcon(const BMessage* msg, icon_size which) return NULL; } - if (msg->FindData(iconName, iconType, &data, &size) == B_OK) - { - ; + if (msg->FindData(iconName, iconType, &data, &size) == B_OK) { bitmap = new BBitmap(BRect(0, 0, bmapSize, bmapSize), ICON_COLOR_SPACE); ASSERT((bitmap->BitsLength() == size)); diff --git a/src/apps/patchbay/EndpointInfo.h b/src/apps/patchbay/EndpointInfo.h index 92a65dc6f5..49a52d841b 100644 --- a/src/apps/patchbay/EndpointInfo.h +++ b/src/apps/patchbay/EndpointInfo.h @@ -11,9 +11,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _EndpointInfo_h -#define _EndpointInfo_h +#ifndef ENDPOINTINFO_H +#define ENDPOINTINFO_H #include /* for icon_size */ #include /* for color_space */ @@ -49,4 +48,4 @@ private: BBitmap* fIcon; }; -#endif /* _EndpointInfo_h */ +#endif /* ENDPOINTINFO_H */ diff --git a/src/apps/patchbay/MidiEventMeter.cpp b/src/apps/patchbay/MidiEventMeter.cpp index 719cf619e8..893f27dd8c 100644 --- a/src/apps/patchbay/MidiEventMeter.cpp +++ b/src/apps/patchbay/MidiEventMeter.cpp @@ -10,14 +10,16 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ + +#include "MidiEventMeter.h" #include #include #include #include #include + #include "CountEventConsumer.h" -#include "MidiEventMeter.h" static const BRect METER_BOUNDS(0, 0, 7, 31); @@ -34,9 +36,9 @@ MidiEventMeter::MidiEventMeter(int32 producerID) fMeterLevel(0) { BMidiRoster* roster = BMidiRoster::MidiRoster(); - if (roster) { + if (roster != NULL) { BMidiProducer* producer = roster->FindProducer(producerID); - if (producer) { + if (producer != NULL) { BString name; name << producer->Name() << " Event Meter"; fCounter = new CountEventConsumer(name.String()); @@ -49,7 +51,7 @@ MidiEventMeter::MidiEventMeter(int32 producerID) MidiEventMeter::~MidiEventMeter() { - if (fCounter) + if (fCounter != NULL) fCounter->Release(); } @@ -58,7 +60,7 @@ void MidiEventMeter::Pulse(BView* view) { int32 newLevel = fMeterLevel; - if (fCounter) { + if (fCounter != NULL) { newLevel = CalcMeterLevel(fCounter->CountEvents()); fCounter->Reset(); } @@ -108,8 +110,7 @@ MidiEventMeter::Draw(BView* view) B_DARKEN_1_TINT, B_NO_TINT}; - for (int32 i = 4; i >= 0; i--) - { + for (int32 i = 4; i >= 0; i--) { rgb_color color; if (fMeterLevel > i) { color = tint_color(METER_GREEN, kTintArray[i]); diff --git a/src/apps/patchbay/MidiEventMeter.h b/src/apps/patchbay/MidiEventMeter.h index 5866e6ec96..6894693b2f 100644 --- a/src/apps/patchbay/MidiEventMeter.h +++ b/src/apps/patchbay/MidiEventMeter.h @@ -11,9 +11,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _MidiEventMeter_h -#define _MidiEventMeter_h +#ifndef MIDIEVENTMETER_H +#define MIDIEVENTMETER_H #include #include @@ -39,4 +38,4 @@ private: int32 fMeterLevel; }; -#endif /* _MidiMeterWidget_h */ +#endif /* MIDIEVENTMETER_H */ diff --git a/src/apps/patchbay/PatchApp.cpp b/src/apps/patchbay/PatchApp.cpp index acf351233d..a443a77f4a 100644 --- a/src/apps/patchbay/PatchApp.cpp +++ b/src/apps/patchbay/PatchApp.cpp @@ -14,6 +14,7 @@ #include "PatchApp.h" #include + #include "PatchWin.h" PatchApp::PatchApp() diff --git a/src/apps/patchbay/PatchApp.h b/src/apps/patchbay/PatchApp.h index e45f32a931..c511da3261 100644 --- a/src/apps/patchbay/PatchApp.h +++ b/src/apps/patchbay/PatchApp.h @@ -10,9 +10,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _PatchApp_h -#define _PatchApp_h +#ifndef PATCHAPP_H +#define PATCHAPP_H #include @@ -24,4 +23,4 @@ public: void MessageReceived(BMessage* msg); }; -#endif /* _PatchApp_h */ +#endif /* PATCHAPP_H */ diff --git a/src/apps/patchbay/PatchRow.cpp b/src/apps/patchbay/PatchRow.cpp index 6dfe3539d6..f22a8ce9a3 100644 --- a/src/apps/patchbay/PatchRow.cpp +++ b/src/apps/patchbay/PatchRow.cpp @@ -19,6 +19,7 @@ #include #include #include + #include "MidiEventMeter.h" extern const float ROW_LEFT = 50.0f; @@ -86,7 +87,7 @@ PatchRow::ID() const void PatchRow::Pulse() { - if (fEventMeter) + if (fEventMeter != NULL) fEventMeter->Pulse(this); } @@ -94,7 +95,7 @@ PatchRow::Pulse() void PatchRow::Draw(BRect) { - if (fEventMeter) + if (fEventMeter != NULL) fEventMeter->Draw(this); } @@ -121,12 +122,12 @@ PatchRow::RemoveColumn(int32 consumerID) int32 numChildren = CountChildren(); for (int32 i = 0; i < numChildren; i++) { PatchCheckBox* box = dynamic_cast(ChildAt(i)); - if (box && box->ConsumerID() == consumerID) { + if (box != NULL && box->ConsumerID() == consumerID) { RemoveChild(box); delete box; while (i < numChildren) { box = dynamic_cast(ChildAt(i++)); - if (box) + if (box != NULL) box->MoveBy(-COLUMN_WIDTH, 0); } break; @@ -141,7 +142,7 @@ PatchRow::Connect(int32 consumerID) int32 numChildren = CountChildren(); for (int32 i = 0; i < numChildren; i++) { PatchCheckBox* box = dynamic_cast(ChildAt(i)); - if (box && box->ConsumerID() == consumerID) + if (box != NULL && box->ConsumerID() == consumerID) box->SetValue(1); } } @@ -153,7 +154,7 @@ PatchRow::Disconnect(int32 consumerID) int32 numChildren = CountChildren(); for (int32 i = 0; i < numChildren; i++) { PatchCheckBox* box = dynamic_cast(ChildAt(i)); - if (box && box->ConsumerID() == consumerID) + if (box != NULL && box->ConsumerID() == consumerID) box->SetValue(0); } } @@ -167,7 +168,7 @@ PatchRow::AttachedToWindow() int32 numChildren = CountChildren(); for (int32 i = 0; i < numChildren; i++) { PatchCheckBox* box = dynamic_cast(ChildAt(i)); - if (box) + if (box != NULL) box->SetTarget(this); } } @@ -182,7 +183,7 @@ PatchRow::MessageReceived(BMessage* msg) BControl* ctrl; if (msg->FindPointer("source", (void**) &ctrl) == B_OK) { PatchCheckBox* box = dynamic_cast(ctrl); - if (box) + if (box != NULL) box->DoConnect(); } } @@ -208,9 +209,9 @@ PatchCheckBox::DoConnect() BMidiProducer* producer = roster->FindProducer(fProducerID); BMidiConsumer* consumer = roster->FindConsumer(fConsumerID); - if (producer && consumer) { + if (producer != NULL && consumer != NULL) { status_t err; - if (value) + if (value != 0) err = producer->Connect(consumer); else err = producer->Disconnect(consumer); @@ -221,6 +222,8 @@ PatchCheckBox::DoConnect() } else SetValue(inverseValue); - if (producer) producer->Release(); - if (consumer) consumer->Release(); + if (producer != NULL) + producer->Release(); + if (consumer != NULL) + consumer->Release(); } diff --git a/src/apps/patchbay/PatchRow.h b/src/apps/patchbay/PatchRow.h index 21977b6c59..2e970769e2 100644 --- a/src/apps/patchbay/PatchRow.h +++ b/src/apps/patchbay/PatchRow.h @@ -9,9 +9,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _PatchRow_h -#define _PatchRow_h +#ifndef PATCHROW_H +#define PATCHROW_H #include @@ -47,4 +46,4 @@ private: MidiEventMeter* fEventMeter; }; -#endif /* _PatchRow_h */ +#endif /* PATCHROW_H */ diff --git a/src/apps/patchbay/PatchView.cpp b/src/apps/patchbay/PatchView.cpp index dc0054e49a..55892f4ed6 100644 --- a/src/apps/patchbay/PatchView.cpp +++ b/src/apps/patchbay/PatchView.cpp @@ -22,6 +22,7 @@ #include #include #include + #include "EndpointInfo.h" #include "PatchRow.h" #include "UnknownDeviceIcons.h" @@ -112,7 +113,8 @@ PatchView::GetToolTipAt(BPoint point, BToolTip** tip) endpoint_itor itor; for (itor = begin; itor != end; itor++, index--) - if (index <= 0) break; + if (index <= 0) + break; if (itor == end) return false; diff --git a/src/apps/patchbay/PatchView.h b/src/apps/patchbay/PatchView.h index 3298c5bf3a..15d4cb9bc6 100644 --- a/src/apps/patchbay/PatchView.h +++ b/src/apps/patchbay/PatchView.h @@ -12,13 +12,13 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _PatchView_h -#define _PatchView_h +#ifndef PATCHVIEW_H +#define PATCHVIEW_H #include #include #include + #include "EndpointInfo.h" class PatchRow; @@ -70,4 +70,4 @@ private: BBitmap* fUnknownDeviceIcon; }; -#endif /* _PatchView_h */ +#endif /* PATCHVIEW_H */ diff --git a/src/apps/patchbay/PatchWin.cpp b/src/apps/patchbay/PatchWin.cpp index 8c45054758..0ef094799b 100644 --- a/src/apps/patchbay/PatchWin.cpp +++ b/src/apps/patchbay/PatchWin.cpp @@ -14,6 +14,7 @@ #include "PatchWin.h" #include + #include "PatchView.h" diff --git a/src/apps/patchbay/PatchWin.h b/src/apps/patchbay/PatchWin.h index c5659ea915..0667d23ee0 100644 --- a/src/apps/patchbay/PatchWin.h +++ b/src/apps/patchbay/PatchWin.h @@ -10,9 +10,8 @@ * Copyright 1999, Be Incorporated. All Rights Reserved. * This file may be used under the terms of the Be Sample Code License. */ - -#ifndef _PatchWin_h -#define _PatchWin_h +#ifndef PATCHWIN_H +#define PATCHWIN_H #include @@ -27,4 +26,4 @@ private: PatchView* fPatchView; }; -#endif /* _PatchWin_h */ +#endif /* PATCHWIN_H */