コンテンツにスキップ

Symfonium カスタム文字列テンプレート

v12.0+ が必要

このページでは、Symfonium のカスタム文字列テンプレート構文と、各コンテキストで利用できるフィールド一覧を説明します。

構成は次のとおりです。

  • 共通テンプレート構文: プレースホルダー、条件ブロック、条件 / 演算子、テキスト装飾、エスケープ規則、グローバルなローカライズ済み string.* ラベル
  • コンテキスト別セクション:
    • 再生中: 追加機能 (\t\onext. フィールド、chapter.* フィールド) と再生中の全フィールド一覧
    • アルバムサブタイトル: アルバムページで利用できるアルバム単位のフィールド
    • アーティストサブタイトル: アーティストページで利用できるアーティスト単位のフィールド

共通テンプレート構文 (どこでも使用可能)

Section titled “共通テンプレート構文 (どこでも使用可能)”

構文: %fieldname%

  • %fieldname% をフィールド値に置き換えます。
  • フィールドが空または存在しない場合、何も表示されません。

例:

テンプレート 結果例
%title% by %artist% Seven Nation Army by The White Stripes
%album% (%year%) Thriller (1982)
%composer% ● %artist% Ludwig van Beethoven ● Berliner Philharmoniker
%artist%%lb%%composer% Berliner Philharmoniker
Ludwig van Beethoven

%lb% は改行です。


何かが存在する場合、または条件に一致する場合だけ、句読点やラベルを表示するにはブロックを使います。

構文: { ... }

  • { ... } ブロックは、最初のプレースホルダーが次のいずれかに一致する場合だけ表示されます。
    • 空でないフィールド
    • true の条件プレースホルダー (%|condition%)
  • 同じ { ... } ブロック内に複数のプレースホルダーと通常テキストを含められますが、ブロックを表示するかどうかを制御するのは最初のプレースホルダーだけです。
  • 必要なスペースはブロック内に入れてください。例: { by %artist%}

フィールドに基づく条件ブロック

Section titled “フィールドに基づく条件ブロック”

例:

テンプレート 結果例 フィールドが空の場合
%title%{ by %artist%} Seven Nation Army by The White Stripes Seven Nation Army
%album%{ (%year%)} Thriller (1982) Thriller
{%composer% ● }%artist% Beethoven ● Berliner Philharmoniker Berliner Philharmoniker

値を表示せずにブロックの表示だけを制御するには、最初のプレースホルダーとして %|condition% を使います。

例:

{%|format.samplerate>"48"% Hi-Res: %format.codec%}

format.samplerate > 48 の場合だけ Hi-Res: FLAC を表示します。

条件ブロック内では \n を使います。

%album%{\n(%year%)}

{ ... } の外では、改行には %lb% を使うことをおすすめします。


構文: %field|condition%

条件が true の場合だけフィールドを出力します。

比較できるもの:

  • 別のフィールド名。例: artistcomposeryear
  • 引用符付きの文字列または数値リテラル。例: "2012""Rock""256"

リテラルに関する注意:

  • track は track フィールドを意味します。
  • "track" は文字列 track を意味します。
  • 値の中に引用符を含めることもできます。リテラルが " で始まり " で終わるようにしてください。

例:

%year|year>"2012"%
%composer|composer!=artist%
%composer|genre=="Classical"%

演算子 意味 注意
== 等しい genre=="Classical" / artist==composer
!= 等しくない artist!="Metallica"
+= 含む genre+="Rock" リテラルまたは別フィールドで動作します
-= 含まない mood-="depressing"
> より大きい year>"1999" 数値リテラルには引用符を使います
< より小さい duration<"500" duration は秒単位です
==empty 空である year==empty empty は予約語です
!=empty 空ではない composer!=empty empty は予約語です
[] 範囲内 bpm[]"0".."100" 境界値を含みます

  • AND には && を使います。
  • OR には || を使います。
  • 同じ条件内で &&|| を混在できます。
  • 評価優先順位を制御するには括弧 (...) を使います。

例:

%format|format.bitdepth!=empty && (format.samplerate>"48" || format.bitdepth>"24")%

これは、ビット深度が存在し、かつ次のいずれかの場合にのみ %format% を出力します。

  • サンプルレートが 48 より大きい
  • ビット深度が 24 より大きい

インラインテキスト装飾マークアップ

Section titled “インラインテキスト装飾マークアップ”
**Bold**
__Underline__
~~Strike~~
//Italics//
^^CAPS^^

ローカライズ済みラベル (string.*)

Section titled “ローカライズ済みラベル (string.*)”

これらのプレースホルダーは、ユーザーのロケールで翻訳済み文字列を返します。

  • string.hires
  • string.lossless
  • string.lossy
  • string.hires.lossless
  • string.low.quality
  • string.high.quality
  • string.high.efficiency
  • string.time.unit.day.short
  • string.time.unit.hour.short
  • string.time.unit.minute.short
  • string.time.unit.second.short
  • string.time.unit.day.one
  • string.time.unit.day.other
  • string.time.unit.hour.one
  • string.time.unit.hour.other
  • string.time.unit.minute.one
  • string.time.unit.minute.other
  • string.time.unit.second.one
  • string.time.unit.second.other
  • string.track.one
  • string.track.other
  • string.album.one
  • string.album.other

再生中テンプレートでは次へアクセスできます。

  • トラックメタデータ
  • 再生状態
  • キュー状態
  • チャプター状態
  • 音声形式
  • EQ / レンダラー情報
  • その他

\t を使うと、1 つのテンプレートを複数セグメントに分割できます。

例:

%player.position%\t%format%\t%player.duration%

水平方向の配置が space between の場合、通常は次のように描画されます。

  • 左: 位置
  • 中央: 形式
  • 右: 長さ

\o による選択的な保護オーバーレイ

Section titled “\o による選択的な保護オーバーレイ”

文字列全体が保護されていなくても、その部分にだけ保護オーバーレイを適用するには \o を使います。

次のキュー項目を参照するには、項目データフィールドの前に next. を追加します。

%next.title%

チャプターフィールドでは、next.chapter.* が次のチャプターを参照します。


トラック / アルバムメタデータ

Section titled “トラック / アルバムメタデータ”
  • title
  • title.raw
  • cleantitle (追加されたトラック番号や explicit 記号を除いたタイトル)
  • artist
  • album
  • album.raw
  • album.version
  • album.type (Release Type とも呼ばれます)
  • albumartist
  • album.tags
  • album.title
  • album.title.raw
  • album.title.version
  • composer
  • year
  • releasedate
  • originaldate
  • releasedate.year
  • originaldate.year
  • track
  • disc
  • disctitle
  • duration
  • duration.seconds (合計秒数)
  • duration.d (ゼロの場合に非表示にするには .nz を追加)
  • duration.h (ゼロの場合に非表示にするには .nz を追加)
  • duration.m (ゼロの場合に非表示にするには .nz を追加)
  • duration.s (ゼロの場合に非表示にするには .nz を追加)
  • duration.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • bpm
  • genre
  • style
  • mood
  • occasion
  • grouping
  • language
  • comment
  • work
  • movement.name
  • movement.number
  • movement.number.roman
  • mediatype
  • providername
  • offlinestatus
  • explicit
  • favorite
  • userrating
  • rating
  • userrating.5 (5 つ星に正規化)
  • rating.5 (5 つ星に正規化)
  • track.tags
  • original.artist
  • original.album
  • filepath
  • filename
  • lastplayed
  • lastSkipped
  • isaudiobook
  • playcount
  • skipcount
  • player.position
  • player.duration
  • player.remaining
  • player.position.seconds
  • player.duration.seconds
  • player.remaining.seconds
  • player.paused
  • player.repeat.mode
  • player.shuffle.mode
  • volume.current
  • sleep.timer
  • sleep.timer.seconds
  • sleep.timer.eos
  • queue.position
  • queue.size
  • queue.name
  • smartqueue
  • smartflow
  • radio.mode (Smart Queue の場合は 1、Smart Flow の場合は 2 以上)
  • chapter.count
  • chapter.index
  • chapter.title
  • chapter.position
  • chapter.position.seconds
  • chapter.position.d (ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.h (ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.m (ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.s (ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.position.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining
  • chapter.remaining.seconds
  • chapter.remaining.d (ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.h (ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.m (ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.s (ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.remaining.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration
  • chapter.duration.seconds
  • chapter.duration.d (ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.h (ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.m (ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.s (ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.duration.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position
  • chapter.all.position.seconds
  • chapter.all.position.d (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.h (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.m (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.s (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.position.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining
  • chapter.all.remaining.seconds
  • chapter.all.remaining.d (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.h (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.m (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.s (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.remaining.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration
  • chapter.all.duration.seconds
  • chapter.all.duration.d (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.h (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.m (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.s (ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • chapter.all.duration.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • format
  • format.bitrate
  • format.bitrate.raw
  • format.samplerate
  • format.samplerate.raw
  • format.bitdepth
  • format.codec
  • format.bitandsample
  • format.channels
  • eq.profile
  • eq.config
  • output.current
  • renderer.current
  • renderer.type
  • lb (改行)
  • bool1
  • bool2
  • bool3
  • bool4
  • bool5

きれいな 2 行タイトルブロック

Section titled “きれいな 2 行タイトルブロック”
%title%%lb%{by %artist%}

year が存在する場合だけアルバム + 年

Section titled “year が存在する場合だけアルバム + 年”
%album%{ (%year%)}

composer が存在する場合だけ Composer ● Artist

Section titled “composer が存在する場合だけ Composer ● Artist”
{%composer% ● }%artist%

\t を使った 3 分割行 (位置 / 形式 / 長さ)

Section titled “\t を使った 3 分割行 (位置 / 形式 / 長さ)”
%player.position%\t%format%\t%player.duration%

高サンプルレートの場合だけ Hi-Res を表示

Section titled “高サンプルレートの場合だけ Hi-Res を表示”
{%|format.samplerate>"48"% Hi-Res: %format.codec%}

アクティブな出力端末を表示 (Android とその他レンダラー)

Section titled “アクティブな出力端末を表示 (Android とその他レンダラー)”
{ %output.current|renderer.type=="Android"%}{ %renderer.current|renderer.type!="Android"%}

切り替え可能な Apple 風品質インジケーター (bool1 を使用)

Section titled “切り替え可能な Apple 風品質インジケーター (bool1 を使用)”
ⓘ {%format|bool1=="true"%}{Dolby Atmos %|format.channels>"2" && bool1=="false"%}{%string.high.efficiency|format.bitrate>"10" && format.bitrate<"256" && format.bitdepth==empty && bool1=="false"%}{%string.high.quality|format.bitrate>"255" && format.bitrate<"321" && format.bitdepth==empty && bool1=="false"%}{%string.lossless|format.bitdepth[]"16".."24" && format.samplerate<"49" && bool1=="false"%}{%string.hires.lossless|format.bitdepth[]"16".."32" && format.samplerate>"48" && bool1=="false"%}

カスタム文字列に toggle bool1 アクションを割り当てると、次を交互に切り替えます。

  • bool1 が true の場合は %format% を表示
  • bool1 が false の場合は Apple 風インジケーターを表示
Vol %volume.current%%

現在のチャプタータイトルとインデックス

Section titled “現在のチャプタータイトルとインデックス”
{%chapter.index% - }%chapter.title%

現在のチャプターの経過 / 残り

Section titled “現在のチャプターの経過 / 残り”
%chapter.position%\t%chapter.title%\t%chapter.remaining%

最初のチャプターを基準にしたオーディオブック全体の進行

Section titled “最初のチャプターを基準にしたオーディオブック全体の進行”
%chapter.all.position%\t%chapter.all.duration%
%next.chapter.title%
%format.codec% • %format.bitdepth%/%format.samplerate.raw% • %format.bitrate.raw%

アルバムサブタイトル (アルバムページ)

Section titled “アルバムサブタイトル (アルバムページ)”

アルバムページでは通常、キューやプレーヤー状態ではなく、アルバム単位のメタデータが公開されます。同じ共通テンプレート構文を使用できます。

対応フィールド (アルバムサブタイトル)

Section titled “対応フィールド (アルバムサブタイトル)”
  • title
  • title.raw
  • version
  • tags
  • type
  • status
  • composer
  • artist
  • year
  • duration
  • duration.seconds (合計秒数)
  • duration.d (ゼロの場合に非表示にするには .nz を追加)
  • duration.h (ゼロの場合に非表示にするには .nz を追加)
  • duration.m (ゼロの場合に非表示にするには .nz を追加)
  • duration.s (ゼロの場合に非表示にするには .nz を追加)
  • duration.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • genre
  • style
  • mood
  • language
  • providername
  • offlinestatus
  • occasion
  • mediatype
  • grouping
  • explicit
  • releasedate
  • originaldate
  • releasedate.year
  • originaldate.year
  • lastplayed
  • lastSkipped
  • userrating
  • rating
  • userrating.5
  • rating.5
  • favorite
  • song.count
  • playcount
  • skipcount
  • description
  • format
  • format.bitrate
  • format.channels
  • format.samplerate
  • format.bitdepth
  • format.codec
  • format.bitandsample
  • format.bitrate.raw
  • format.samplerate.raw
  • lb

version が存在する場合だけアルバムタイトル + version

Section titled “version が存在する場合だけアルバムタイトル + version”
%title%{ — %version%}

欠けている部分をスキップする year + genre 行

Section titled “欠けている部分をスキップする year + genre 行”
%year%{ • %genre%}

ユーザー評価がある場合だけ評価を表示

Section titled “ユーザー評価がある場合だけ評価を表示”
{★ %userrating.5%/5%|userrating!=empty%}
{⬇ Offline%|offlinestatus!=empty%}

アーティストサブタイトル (アーティストページ)

Section titled “アーティストサブタイトル (アーティストページ)”

アーティストページでは通常、アーティスト単位のメタデータとライブラリ統計が公開されます。同じ共通テンプレート構文を使用できます。

対応フィールド (アーティストサブタイトル)

Section titled “対応フィールド (アーティストサブタイトル)”
  • title
  • title.raw
  • version
  • tags
  • type
  • gender
  • duration
  • duration.seconds (合計秒数)
  • duration.d (ゼロの場合に非表示にするには .nz を追加)
  • duration.h (ゼロの場合に非表示にするには .nz を追加)
  • duration.m (ゼロの場合に非表示にするには .nz を追加)
  • duration.s (ゼロの場合に非表示にするには .nz を追加)
  • duration.dd (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.hh (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.mm (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • duration.ss (ゼロ埋め。ゼロの場合に非表示にするには .nz を追加)
  • genre
  • style
  • mood
  • song.count
  • album.count
  • instrument
  • providername
  • offlinestatus
  • lastplayed
  • userrating
  • userrating.5
  • favorite
  • playcount
  • description
  • lb

アーティストサブタイトルの例

Section titled “アーティストサブタイトルの例”
%song.count% songs{ • %album.count% albums}
%genre%{ • %style%}

お気に入りの場合だけ Favorite バッジを表示

Section titled “お気に入りの場合だけ Favorite バッジを表示”
{♥ Favorite%|favorite!=empty%}
%title%{\n%instrument%}