Switch to unified view

a/src/rcvqueue.h b/src/rcvqueue.h
...
...
47
    unsigned int m_bytes;
47
    unsigned int m_bytes;
48
    char *m_buf;
48
    char *m_buf;
49
    unsigned int m_curoffs; /* Used by the http data emitter */
49
    unsigned int m_curoffs; /* Used by the http data emitter */
50
};
50
};
51
51
52
// Def for the downstream module which can be using either http to mpd
53
// or direct alsa. No effort is done for easy expansion to other
54
// modules, e.g. this would need to add stuff to the Context thing
55
// etc. but this seems sufficient for expected needs.
56
// Note that the module does not derive from this class, it initializes an
57
// object with appropriate values.
58
class AudioEater {
59
public:
60
    enum BOrder {BO_MSB, BO_LSB, BO_HOST};
61
    struct Context {
62
        Context(WorkQueue<AudioMessage*> *q, int p = 0) : port(p), queue(q) {}
63
        int port;
52
extern WorkQueue<AudioMessage*> audioqueue;
64
        WorkQueue<AudioMessage*> *queue;
65
    };
53
66
54
/** Worker routine for fetching bufs from the rcvqueue and making them
67
    // Constructor called by downstream module to set its params
55
 *  available to HTTP. the param is actually an AudioEaterContext */
68
    AudioEater(BOrder o, void *(*w)(void *))
56
extern void *audioEater(void *);
69
        : input_border(o), worker(w) {
70
    }
57
71
58
struct AudioEaterContext {
72
    BOrder input_border;
59
    AudioEaterContext(int p = 0) : port(p) {}
73
    /** Worker routine for fetching bufs from the rcvqueue and sending them
60
    int port;
74
     * further. The param is actually an AudioEater::Context */
75
    void *(*worker)(void *);
61
};
76
};
62
77
78
extern AudioEater httpAudioEater;
79
extern AudioEater alsaAudioEater;
80
63
#endif /* _RCVQUEUE_H_INCLUDED_ */
81
#endif /* _RCVQUEUE_H_INCLUDED_ */