本文整理匯總了Golang中github.com/ianr0bkny/go-sonos/model.ObjectStream函數的典型用法代碼示例。如果您正苦於以下問題:Golang ObjectStream函數的具體用法?Golang ObjectStream怎麽用?Golang ObjectStream使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ObjectStream函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: GetGenreArtists
func (this *Sonos) GetGenreArtists(genre string) ([]model.Object, error) {
req := &upnp.BrowseRequest{
ObjectID: objectIDForGenre(genre),
BrowseFlag: upnp.BrowseFlag_BrowseDirectChildren,
Filter: upnp.BrowseFilter_All,
StartingIndex: 0,
RequestCount: 0,
SortCriteria: upnp.BrowseSortCriteria_None,
}
if result, err := this.Browse(req); nil != err {
log.Printf("Could not browse artists for genre `%s': %v", genre, err)
return nil, err
} else {
return model.ObjectStream(result.Doc), nil
}
}
示例2: ListSavedQueues
func (this *Sonos) ListSavedQueues() (objects []model.Object, err error) {
var result *upnp.BrowseResult
req := &upnp.BrowseRequest{
ObjectID: ObjectID_SavedQueues,
BrowseFlag: upnp.BrowseFlag_BrowseDirectChildren,
Filter: upnp.BrowseFilter_All,
StartingIndex: 0,
RequestCount: 0,
SortCriteria: upnp.BrowseSortCriteria_None,
}
if result, err = this.Browse(req); nil != err {
return
} else {
objects = model.ObjectStream(result.Doc)
}
return
}
示例3: GetArtistAlbums
func (this *Sonos) GetArtistAlbums(artist string) (objects []model.Object, err error) {
var result *upnp.BrowseResult
req := &upnp.BrowseRequest{
ObjectID: objectIDForArtist(artist),
BrowseFlag: upnp.BrowseFlag_BrowseDirectChildren,
Filter: upnp.BrowseFilter_All,
StartingIndex: 0,
RequestCount: 0,
SortCriteria: upnp.BrowseSortCriteria_None,
}
if result, err = this.Browse(req); nil != err {
return
} else {
objects = model.ObjectStream(result.Doc)
}
return
}
示例4: GetAlbumTracks
func (this *Sonos) GetAlbumTracks(album string) ([]model.Object, error) {
req := &upnp.BrowseRequest{
ObjectID: objectIDForAlbum(album),
BrowseFlag: upnp.BrowseFlag_BrowseDirectChildren,
Filter: upnp.BrowseFilter_All,
StartingIndex: 0,
RequestCount: 0,
SortCriteria: upnp.BrowseSortCriteria_None,
}
log.Printf("Browsing tracks for album `%s'", album)
if result, err := this.Browse(req); nil != err {
log.Printf("Could not browse tracks for album `%s': %v", album, err)
return nil, err
} else {
return model.ObjectStream(result.Doc), nil
}
}
示例5: GetMetadata
func (this *Sonos) GetMetadata(objectId string) (objects []model.Object, err error) {
var result *upnp.BrowseResult
req := &upnp.BrowseRequest{
ObjectID: objectId,
BrowseFlag: upnp.BrowseFlag_BrowseMetadata,
Filter: upnp.BrowseFilter_All,
StartingIndex: 0,
RequestCount: 0,
SortCriteria: upnp.BrowseSortCriteria_None,
}
if result, err = this.Browse(req); nil != err {
return
} else {
objects = model.ObjectStream(result.Doc)
}
return
}
示例6: ListQueues
func (this *Sonos) ListQueues() (objects []model.Object, err error) {
var result *upnp.BrowseResult
req := &upnp.BrowseRequest{
ObjectID_Queues,
upnp.BrowseFlag_BrowseDirectChildren,
upnp.BrowseFilter_All,
0, /*StartingIndex*/
0, /*RequestCount*/
upnp.BrowseSortCriteria_None,
}
if result, err = this.Browse(req); nil != err {
return
} else {
objects = model.ObjectStream(result.Doc)
}
return
}
示例7: GetGenreArtists
func (this *Sonos) GetGenreArtists(genre string) ([]model.Object, error) {
req := &upnp.BrowseRequest{
objectIDForGenre(genre),
upnp.BrowseFlag_BrowseDirectChildren,
upnp.BrowseFilter_All,
0, /*StartingIndex*/
0, /*RequestCount*/
upnp.BrowseSortCriteria_None,
}
if result, err := this.Browse(req); nil != err {
log.Printf("Could not browse artists for genre `%s': %v", genre, err)
return nil, err
} else {
return model.ObjectStream(result.Doc), nil
}
panic("unreachable")
}