當前位置: 首頁>>代碼示例>>Golang>>正文


Golang model.ObjectStream函數代碼示例

本文整理匯總了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
	}
}
開發者ID:shineit,項目名稱:go-sonos,代碼行數:16,代碼來源:browse.go

示例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
}
開發者ID:shineit,項目名稱:go-sonos,代碼行數:17,代碼來源:browse.go

示例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
}
開發者ID:shineit,項目名稱:go-sonos,代碼行數:17,代碼來源:browse.go

示例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
	}
}
開發者ID:shineit,項目名稱:go-sonos,代碼行數:17,代碼來源:browse.go

示例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
}
開發者ID:shineit,項目名稱:go-sonos,代碼行數:17,代碼來源:browse.go

示例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
}
開發者ID:chrisabruce,項目名稱:go-sonos,代碼行數:17,代碼來源:browse.go

示例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")
}
開發者ID:chrisabruce,項目名稱:go-sonos,代碼行數:17,代碼來源:browse.go


注:本文中的github.com/ianr0bkny/go-sonos/model.ObjectStream函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。