Changeset f3fced0 in mainline for uspace/srv/audio/hound/hound.c
- Timestamp:
- 2012-07-13T05:39:36Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9b2ac3d
- Parents:
- 63d6ff9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/hound.c
r63d6ff9 rf3fced0 55 55 audio_ ## type ## _list_instance(it); \ 56 56 if (str_cmp(name, dev->name) == 0) { \ 57 log_debug("%s with name '%s' is already present", \57 log_debug("%s with name '%s' is in the list", \ 58 58 #type, name); \ 59 59 return dev; \ … … 82 82 list_initialize(&hound->devices); 83 83 list_initialize(&hound->sources); 84 list_initialize(&hound->available_sources);85 84 list_initialize(&hound->sinks); 86 85 return EOK; … … 202 201 } 203 202 203 int hound_connect(hound_t *hound, const char* source_name, const char* sink_name) 204 { 205 assert(hound); 206 log_verbose("Connecting '%s' to '%s'.", source_name, sink_name); 207 fibril_mutex_lock(&hound->list_guard); 208 audio_source_t *source = 209 find_source_by_name(&hound->sources, source_name); 210 audio_sink_t *sink = find_sink_by_name(&hound->sinks, sink_name); 211 if (!source || !sink) { 212 fibril_mutex_unlock(&hound->list_guard); 213 log_debug("Sink (%p), or source (%p) not found", sink, source); 214 return ENOENT; 215 } 216 list_remove(&source->link); 217 const int ret = audio_sink_add_source(sink, source); 218 if (ret != EOK) { 219 log_debug("Failed add source to sink list: %s", str_error(ret)); 220 list_append(&source->link, &hound->sources); 221 } 222 fibril_mutex_unlock(&hound->list_guard); 223 return EOK; 224 } 225 226 int hound_disconnect(hound_t *hound, const char* source_name, const char* sink_name) 227 { 228 return ENOTSUP; 229 } 204 230 /** 205 231 * @}
Note:
See TracChangeset
for help on using the changeset viewer.