mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-03 12:30:08 +00:00
dma: Add is_active method for input channels.
Since DBDMA contains an input and output channel, rename the existing is_active method to is_out_active.
This commit is contained in:
parent
31036b8dee
commit
29d13aef09
@ -429,7 +429,16 @@ int DMAChannel::push_data(const char* src_ptr, int len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool DMAChannel::is_active() {
|
||||
bool DMAChannel::is_out_active() {
|
||||
if (this->ch_stat & CH_STAT_DEAD || !(this->ch_stat & CH_STAT_ACTIVE)) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool DMAChannel::is_in_active() {
|
||||
if (this->ch_stat & CH_STAT_DEAD || !(this->ch_stat & CH_STAT_ACTIVE)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -92,7 +92,8 @@ public:
|
||||
uint32_t reg_read(uint32_t offset, int size);
|
||||
void reg_write(uint32_t offset, uint32_t value, int size);
|
||||
|
||||
bool is_active();
|
||||
bool is_out_active();
|
||||
bool is_in_active();
|
||||
DmaPullResult pull_data(uint32_t req_len, uint32_t *avail_len, uint8_t **p_data);
|
||||
int push_data(const char* src_ptr, int len);
|
||||
|
||||
|
@ -35,7 +35,7 @@ class DmaOutChannel {
|
||||
public:
|
||||
DmaOutChannel(std::string name) { this->name = name; };
|
||||
|
||||
virtual bool is_active() { return true; };
|
||||
virtual bool is_out_active() { return true; };
|
||||
virtual DmaPullResult pull_data(uint32_t req_len, uint32_t *avail_len,
|
||||
uint8_t **p_data) = 0;
|
||||
|
||||
@ -49,7 +49,9 @@ class DmaInChannel {
|
||||
public:
|
||||
DmaInChannel(std::string name) { this->name = name; };
|
||||
|
||||
virtual bool is_in_active() { return true; };
|
||||
virtual int push_data(const char* src_ptr, int len) = 0;
|
||||
|
||||
std::string get_name(void) { return this->name; };
|
||||
|
||||
private:
|
||||
|
@ -108,7 +108,7 @@ long sound_out_callback(cubeb_stream *stream, void *user_data,
|
||||
long frames, out_frames;
|
||||
DmaOutChannel *dma_ch = static_cast<DmaOutChannel*>(user_data); /* C API baby! */
|
||||
|
||||
if (!dma_ch->is_active()) {
|
||||
if (!dma_ch->is_out_active()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user