Skip to content

Commit

Permalink
expose setting and size to tier
Browse files Browse the repository at this point in the history
  • Loading branch information
vocatart committed Oct 19, 2024
1 parent e019154 commit 13c6dca
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion textgrid/tiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ type Tier interface {
SetName(string)
SetXmin(float64, ...bool) error
SetXmax(float64, ...bool) error
SetIntervals([]Interval, ...bool) error
GetIntervals() []Interval
GetPoints() []Point
PushInterval(Interval, ...bool) error
PushIntervals([]Interval, ...bool) error
PushPoint(Point, ...bool) error
PushPoints([]Point, ...bool) error
GetSize() int
GetOverlapping() [][]int
sort()
}

Expand Down Expand Up @@ -263,7 +266,7 @@ func (iTier *IntervalTier) PushInterval(intervalPush Interval, warn ...bool) err
return nil
}

// Pushes a slice of intervals to the interval tier. SOrts intervals by minimum x value after pushing the intervals.
// Pushes a slice of intervals to the interval tier. Sorts intervals by minimum x value after pushing the intervals.
func (iTier *IntervalTier) PushIntervals(intervalsPush []Interval, warn ...bool) error {

if len(warn) == 0 {
Expand Down Expand Up @@ -307,6 +310,16 @@ func (iTier *IntervalTier) SetIntervals(newIntervals []Interval, warn ...bool) e
return nil
}

// SetIntervals implements Tier.
func (pTier *PointTier) SetIntervals([]Interval, ...bool) error {
panic("not interval tier")
}

// GetOverlapping implements Tier.
func (pTier *PointTier) GetOverlapping() [][]int {
panic("not interval tier")
}

// Checks for overlaps in an interval tier. Returns a 2d slide of overlapping interval indicies, or nil.
func (iTier IntervalTier) GetOverlapping() [][]int {

Expand Down

0 comments on commit 13c6dca

Please sign in to comment.