diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-01-08 01:13:50 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-01-08 01:13:50 (GMT) |
commit | 6c46b468fc95010f76edca3345d7b80529bc1fce (patch) | |
tree | c757ac71751693c8b4f76ab09e9dda6ccadc5932 /src/helsinki.at/rhimport/rdxport_responses.go | |
parent | 99f7d89b99d6be4cb90fd7be4287eb381196c482 (diff) |
moved rhimport package to rhrd-go repo
Diffstat (limited to 'src/helsinki.at/rhimport/rdxport_responses.go')
-rw-r--r-- | src/helsinki.at/rhimport/rdxport_responses.go | 150 |
1 files changed, 0 insertions, 150 deletions
diff --git a/src/helsinki.at/rhimport/rdxport_responses.go b/src/helsinki.at/rhimport/rdxport_responses.go deleted file mode 100644 index 2871408..0000000 --- a/src/helsinki.at/rhimport/rdxport_responses.go +++ /dev/null @@ -1,150 +0,0 @@ -// -// rhimportd -// -// The Radio Helsinki Rivendell Import Daemon -// -// -// Copyright (C) 2015-2016 Christian Pointner <equinox@helsinki.at> -// -// This file is part of rhimportd. -// -// rhimportd is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// any later version. -// -// rhimportd is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with rhimportd. If not, see <http://www.gnu.org/licenses/>. -// - -package rhimport - -import ( - "encoding/xml" - "fmt" - "io" -) - -type RDWebResult struct { - ResponseCode int `xml:"ResponseCode"` - ErrorString string `xml:"ErrorString"` - AudioConvertError int `xml:"AudioConvertError"` -} - -func NewRDWebResultFromXML(data io.Reader) (res *RDWebResult, err error) { - decoder := xml.NewDecoder(data) - res = &RDWebResult{} - if xmlerr := decoder.Decode(res); xmlerr != nil { - err = fmt.Errorf("Error parsing XML response: %s", xmlerr) - return - } - return -} - -type RDCartAdd struct { - Carts []RDCart `xml:"cart"` -} - -type RDCart struct { - Number uint `xml:"number"` - Type string `xml:"type"` - GroupName string `xml:"groupName"` - Title string `xml:"title"` - Artist string `xml:"artist"` - Album string `xml:"album"` - Year string `xml:"year"` - Label string `xml:"label"` - Client string `xml:"client"` - Agency string `xml:"agency"` - Publisher string `xml:"publisher"` - Composer string `xml:"composer"` - UserDefined string `xml:"userDefined"` - UsageCode uint `xml:"usageCode"` - ForcedLength string `xml:"forcedLength"` - AverageLength string `xml:"averageLength"` - LengthDeviation string `xml:"lengthDeviation"` - AverageSegueLength string `xml:"averageSegueLenth"` - AverageHookLength string `xml:"averageHookLength"` - CutQuantity uint `xml:"cutQuantity"` - LastCutPlayed uint `xml:"lastCutPlayed"` - Validity uint `xml:"validity"` - EnforceLength bool `xml:"enforceLength"` - Asynchronous bool `xml:"asyncronous"` - Owner string `xml:"owner"` - MetadataDatetime string `xml:"metadataDatetime"` -} - -func NewRDCartAddFromXML(data io.Reader) (cart *RDCartAdd, err error) { - decoder := xml.NewDecoder(data) - cart = &RDCartAdd{} - if xmlerr := decoder.Decode(cart); xmlerr != nil { - err = fmt.Errorf("Error parsing XML response: %s", xmlerr) - return - } - return -} - -type RDCutAdd struct { - Cuts []RDCut `xml:"cut"` -} - -type RDCut struct { - Name string `xml:"cutName"` - CartNumber uint `xml:"cartNumber"` - Number uint `xml:"cutNumber"` - EverGreen bool `xml:"evergreen"` - Description string `xml:"description"` - OutCue string `xml:"outcue"` - ISRC string `xml:"isrc"` - ISCI string `xml:"isci"` - Length int `xml:"length"` - OriginDateTime string `xml:"originDatetime"` - StartDateTime string `xml:"startDatetime"` - EndDateTime string `xml:"endDatetime"` - Sunday bool `xml:"sun"` - Monday bool `xml:"mon"` - Tuesday bool `xml:"tue"` - Wednesday bool `xml:"wed"` - Thursday bool `xml:"thu"` - Friday bool `xml:"fri"` - Saturday bool `xml:"sat"` - StartDaypart string `xml:"startDaypart"` - EndDayPart string `xml:"endDaypart"` - OriginName string `xml:"originName"` - Weight int `xml:"weight"` - LastPlayDateTime string `xml:"lastPlayDatetime"` - PlayCounter uint `xml:"playCounter"` - LocalCounter uint `xml:"localCounter"` - Validiy uint `xml:"validity"` - CondingFormat int `xml:"codingFormat"` - SampleRate int `xml:"sampleRate"` - BitRate int `xml:"bitRate"` - Channels int `xml:"channels"` - PlayGain int `xml:"playGain"` - StartPoint int `xml:"startPoint"` - EndPoint int `xml:"endPoint"` - FadeUpPoint int `xml:"fadeupPoint"` - FadeDownPoint int `xml:"fadedownPoint"` - SegueStartPoint int `xml:"segueStartPoint"` - SegueEndPoint int `xml:"segueEndPoint"` - SegueGain int `xml:"segueGain"` - HookStartPoint int `xml:"hookStartPoint"` - HookEndPoint int `xml:"hookEndPoint"` - TalkStartPoint int `xml:"talkStartPoint"` - TalkEndPoint int `xml:"talkEndPoint"` -} - -func NewRDCutAddFromXML(data io.Reader) (cut *RDCutAdd, err error) { - decoder := xml.NewDecoder(data) - cut = &RDCutAdd{} - if xmlerr := decoder.Decode(cut); xmlerr != nil { - err = fmt.Errorf("Error parsing XML response: %s", xmlerr) - return - } - return -} |