Changeset 3b6c1d4 in mainline for uspace/srv/audio/hound/hound.c
- Timestamp:
- 2013-04-02T15:13:12Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 62beb4b
- Parents:
- 2d1fdcad
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/audio/hound/hound.c
r2d1fdcad r3b6c1d4 75 75 FIND_BY_NAME(sink); 76 76 } 77 77 78 static int hound_disconnect_internal(hound_t *hound, const char* source_name, const char* sink_name); 78 79 … … 82 83 fibril_mutex_initialize(&hound->list_guard); 83 84 list_initialize(&hound->devices); 85 list_initialize(&hound->contexts); 84 86 list_initialize(&hound->sources); 85 87 list_initialize(&hound->sinks); 86 88 return EOK; 89 } 90 91 int hound_add_ctx(hound_t *hound, hound_ctx_t *ctx) 92 { 93 log_info("Trying to add context %p", ctx); 94 assert(hound); 95 if (!ctx) 96 return EINVAL; 97 list_append(&ctx->link, &hound->contexts); 98 //TODO register sinks/sources 99 return EOK; 100 } 101 102 int hound_remove_ctx(hound_t *hound, hound_ctx_t *ctx) 103 { 104 assert(hound); 105 if (!ctx) 106 return EINVAL; 107 list_remove(&ctx->link); 108 return EOK; 109 } 110 111 hound_ctx_t *hound_get_ctx_by_id(hound_t *hound, hound_context_id_t id) 112 { 113 assert(hound); 114 115 //TODO locking 116 117 list_foreach(hound->contexts, it) { 118 hound_ctx_t *ctx = hound_ctx_from_link(it); 119 if (hound_ctx_get_id(ctx) == id) 120 return ctx; 121 } 122 return NULL; 87 123 } 88 124
Note:
See TracChangeset
for help on using the changeset viewer.