caminhos de áudio nos instrumentos em projetos
Deploy / Deploy (push) Successful in 47s
Details
Deploy / Deploy (push) Successful in 47s
Details
This commit is contained in:
parent
fafa6528fa
commit
337946a91a
|
@ -114,16 +114,75 @@ title: "{{ page.file }}"
|
||||||
<a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
|
<a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
|
||||||
<code>{{ instrument.instrument_name }}</code>
|
<code>{{ instrument.instrument_name }}</code>
|
||||||
</a>
|
</a>
|
||||||
|
<!-- Instrumentos -->
|
||||||
|
{% if page.tracks and page.tracks.size > 0 %}
|
||||||
|
<section class="instruments-section">
|
||||||
|
<h2 class="title is-5"><code>🎚️ Instrumentos</code></h2>
|
||||||
|
<div class="content">
|
||||||
|
|
||||||
|
<ul style="list-style: none; padding-left: 0;">
|
||||||
|
{% for track in page.tracks %}
|
||||||
|
{% assign tem_instr = false %}
|
||||||
|
{% if track.instruments and track.instruments.size > 0 %}
|
||||||
|
{% assign tem_instr = true %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if instrument.audiofileprocessor and instrument.audiofileprocessor.src %}
|
{% if track.bassline_name or tem_instr %}
|
||||||
<!-- Exibir player de áudio para o instrumento -->
|
<li class="mb-5">
|
||||||
<div class="audio-player-section mt-3">
|
{% if track.bassline_name %}
|
||||||
<audio controls>
|
<p class="has-text-weight-bold mb-2">🎼 {{ track.bassline_name }}</p>
|
||||||
<source src="{{ instrument.audiofileprocessor.src | relative_url }}" type="audio/wav">
|
{% endif %}
|
||||||
Seu navegador não suporta o elemento <code>audio</code>.
|
|
||||||
</audio>
|
{% if tem_instr %}
|
||||||
|
<ul class="pl-4">
|
||||||
|
{% for instrument in track.instruments %}
|
||||||
|
{% if instrument.instrument_name %}
|
||||||
|
<li style="margin-bottom: 0.4rem;">
|
||||||
|
<!-- Gerar link para filtro por instrumento -->
|
||||||
|
{% assign instrument_slug = instrument.instrument_name | replace: ' ', '+' %}
|
||||||
|
<a href="{{ '/instruments/?instrument=' | append: instrument_slug | relative_url }}" class="tag is-info is-light">
|
||||||
|
<code>{{ instrument.instrument_name }}</code>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<!-- Gerar o caminho absoluto para o áudio -->
|
||||||
|
{% assign base_path = "/usr/share/lmms/" %}
|
||||||
|
{% assign found_audio = false %}
|
||||||
|
|
||||||
|
<!-- Vamos tentar procurar em diferentes subpastas -->
|
||||||
|
{% assign subfolders = "instrumentos/sintetizadores, instrumentos/bateria, outros" | split: ", " %}
|
||||||
|
|
||||||
|
{% for folder in subfolders %}
|
||||||
|
{% assign audio_file_path = base_path | append: folder | append: "/" | append: instrument.instrument_name | append: ".wav" %}
|
||||||
|
|
||||||
|
<!-- Verificar se o arquivo de áudio existe no caminho gerado -->
|
||||||
|
{% if audio_file_path %}
|
||||||
|
{% assign found_audio = true %}
|
||||||
|
<div class="audio-player-section mt-3">
|
||||||
|
<audio controls>
|
||||||
|
<source src="{{ audio_file_path }}" type="audio/wav">
|
||||||
|
Seu navegador não suporta o elemento <code>audio</code>.
|
||||||
|
</audio>
|
||||||
|
</div>
|
||||||
|
{% break %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% if found_audio == false %}
|
||||||
|
<p>Áudio não encontrado para este instrumento.</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
</section>
|
||||||
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in New Issue