HaikuDepot: notify work status from main window
[haiku.git] / src / apps / patchbay / PatchView.h
blob15d4cb9bc683ec5d6f0e5b1a0d6370c4b1ee501d
1 /* PatchView.h
2 * -----------
3 * The main PatchBay view contains a row of icons along the top and
4 * left sides representing available consumers and producers, and
5 * a set of PatchRows which build the matrix of connections.
7 * Copyright 2013, Haiku, Inc. All rights reserved.
8 * Distributed under the terms of the MIT License.
10 * Revisions by Pete Goodeve
12 * Copyright 1999, Be Incorporated. All Rights Reserved.
13 * This file may be used under the terms of the Be Sample Code License.
15 #ifndef PATCHVIEW_H
16 #define PATCHVIEW_H
18 #include <Rect.h>
19 #include <View.h>
20 #include <list>
22 #include "EndpointInfo.h"
24 class PatchRow;
25 class BBitmap;
27 using namespace std;
29 class PatchView : public BView
31 public:
32 PatchView(BRect r);
33 ~PatchView();
35 void AttachedToWindow();
36 void MessageReceived(BMessage* msg);
37 void Draw(BRect updateRect);
39 private:
40 typedef enum {
41 TRACK_COLUMN,
42 TRACK_ROW
43 } track_type;
45 BRect ColumnIconFrameAt(int32 index) const;
46 BRect RowIconFrameAt(int32 index) const;
47 virtual bool GetToolTipAt(BPoint point, BToolTip** tip);
49 void AddProducer(int32 id);
50 void AddConsumer(int32 id);
51 void RemoveProducer(int32 id);
52 void RemoveConsumer(int32 id);
53 void UpdateProducerProps(int32 id, const BMessage* props);
54 void UpdateConsumerProps(int32 id, const BMessage* props);
55 void Connect(int32 prod, int32 cons);
56 void Disconnect(int32 prod, int32 cons);
58 void HandleMidiEvent(BMessage* msg);
60 BPoint CalcRowOrigin(int32 rowIndex) const;
61 BPoint CalcRowSize() const;
63 typedef list<EndpointInfo>::iterator endpoint_itor;
64 typedef list<EndpointInfo>::const_iterator const_endpoint_itor;
65 typedef list<PatchRow*>::iterator row_itor;
67 list<EndpointInfo> fProducers;
68 list<EndpointInfo> fConsumers;
69 list<PatchRow*> fPatchRows;
70 BBitmap* fUnknownDeviceIcon;
73 #endif /* PATCHVIEW_H */