| 907 | #endif |
| 908 | |
| 909 | Track::Holder LabelTrack::Copy(double t0, double t1, bool) const |
| 910 | { |
| 911 | auto tmp = std::make_shared<LabelTrack>(); |
| 912 | tmp->Init(*this); |
| 913 | const auto lt = static_cast<LabelTrack*>(tmp.get()); |
| 914 | |
| 915 | for (auto &labelStruct: mLabels) { |
| 916 | LabelStruct::TimeRelations relation = |
| 917 | labelStruct.RegionRelation(t0, t1, this); |
| 918 | if (relation == LabelStruct::SURROUNDS_LABEL) { |
| 919 | LabelStruct l { |
| 920 | labelStruct.selectedRegion, |
| 921 | labelStruct.getT0() - t0, |
| 922 | labelStruct.getT1() - t0, |
| 923 | labelStruct.title |
| 924 | }; |
| 925 | lt->mLabels.push_back(l); |
| 926 | } |
| 927 | else if (relation == LabelStruct::WITHIN_LABEL) { |
| 928 | LabelStruct l { |
| 929 | labelStruct.selectedRegion, |
| 930 | 0, |
| 931 | t1-t0, |
| 932 | labelStruct.title |
| 933 | }; |
| 934 | lt->mLabels.push_back(l); |
| 935 | } |
| 936 | else if (relation == LabelStruct::BEGINS_IN_LABEL) { |
| 937 | LabelStruct l { |
| 938 | labelStruct.selectedRegion, |
| 939 | 0, |
| 940 | labelStruct.getT1() - t0, |
| 941 | labelStruct.title |
| 942 | }; |
| 943 | lt->mLabels.push_back(l); |
| 944 | } |
| 945 | else if (relation == LabelStruct::ENDS_IN_LABEL) { |
| 946 | LabelStruct l { |
| 947 | labelStruct.selectedRegion, |
| 948 | labelStruct.getT0() - t0, |
| 949 | t1 - t0, |
| 950 | labelStruct.title |
| 951 | }; |
| 952 | lt->mLabels.push_back(l); |
| 953 | } |
| 954 | } |
| 955 | lt->mClipLen = (t1 - t0); |
| 956 | |
| 957 | return tmp; |
| 958 | } |
| 959 | |
| 960 | |
| 961 | bool LabelTrack::PasteOver(double t, const Track &src) |
no test coverage detected