-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New audio player - Review of iss127 #135
Changes from 69 commits
8530865
03c9648
ab7fa63
0d64447
96d24da
9ce935b
9cbe00e
08d95b2
f74cf0a
1495332
147fcf5
cf510c5
7e5da79
21c768c
4df5cb7
7b74d89
836d6d3
9f1250b
e97667d
c2a4c6b
a244f05
70c40f2
f603d30
2a090b2
ccbb40f
4bf99ca
fbc93bc
159dd1b
37e48cb
965f256
6b1d4f4
d99466d
0272704
dcf2159
b870d46
34f3b4f
1d1895c
d735dea
31b2e61
a658f18
6379e66
d601439
8c36e78
276130e
03f45ae
13dc3bd
c1fe52c
1b900c3
c3098e9
c6d5f3b
62e0500
2256e2c
9df6a6b
67cc1fd
974710d
6259f47
63bb430
ee4172c
fc36e9d
b2b72eb
74afc99
02d3d1c
e310849
3049857
fe0e9c8
2af81e4
bc9d961
026568f
a8b1728
ada0523
fbadade
c27a84e
31d9ffa
7082110
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,6 @@ dist/ | |
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from django.core.management.base import BaseCommand | ||
from datasets.tasks import refresh_sound_extra_data | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Refresh the extra_data field in Sound model' \ | ||
|
||
|
||
def add_arguments(self, parser): | ||
pass | ||
|
||
def handle(self, *args, **options): | ||
refresh_sound_extra_data() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% load staticfiles %} | ||
|
||
{% block extra_head %} | ||
<link rel="stylesheet" type="text/css" href="{% static "audio-annotator/css/player.css" %}"/> | ||
<!--script src="{% static "audio-annotator/js/lib/materialize.min.js" %}" type="text/javascript"></script--> | ||
<script src="{% static "audio-annotator/js/lib/wavesurfer.min.js" %}" type="text/javascript"></script> | ||
<!--script src="{% static "audio-annotator/js/lib/wavesurfer.spectrogram.min.js" %}" type="text/javascript"></script--> | ||
<!--script src="{% static "audio-annotator/js/colormap/colormap.min.js" %}" type="text/javascript"></script--> | ||
<!--script src="{% static "audio-annotator/js/src/annotation_stages.js" %}" type="text/javascript"></script--> | ||
<!--script src="{% static "audio-annotator/js/src/hidden_image.js" %}" type="text/javascript"></script--> | ||
<!--script src="{% static "audio-annotator/js/src/components.js" %}" type="text/javascript"></script--> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clear commented script here |
||
<script src="{% static "audio-annotator/js/src/player.js" %}" type="text/javascript"></script> | ||
{% endblock %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% load general_templatetags %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think loading the general template tags here is not needed |
||
|
||
<div class="player_container"> | ||
|
||
<div class="soundplayer {{ player_size }}" id="s{{ freesound_id }}_{{ player_id }}"> | ||
<div class="ui active dimmer"> | ||
<div class="ui loader"></div> | ||
</div> | ||
<div class="wavesurfer"></div> | ||
<div class="playbar"></div> | ||
</div> | ||
|
||
<script type="text/javascript"> | ||
var playerOptions = { | ||
size: "{{ player_size }}", | ||
player_id: "{{ player_id }}", | ||
freesound_id: "{{ freesound_id }}", | ||
sound_url: "{{ sound_url }}", | ||
waveform_url: "{{ waveform_url }}", | ||
spectrogram_url: "{{ spectrogram_url }}", | ||
}; | ||
|
||
var player = new Player(playerOptions) | ||
</script> | ||
|
||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{% extends "base.html" %} | ||
{% load staticfiles %} | ||
{% load dataset_templatetags %} | ||
{% load general_templatetags %} | ||
{% block title %}{{ node.name }}{% endblock title %} | ||
|
||
{% block content %} | ||
|
@@ -30,7 +31,10 @@ <h2>Audio samples with candidate annotations for <div class="ui huge label">{{ n | |
<tbody> | ||
{% for sound in sounds %} | ||
<tr> | ||
<td>{{ sound.freesound_id | fs_embed | safe }}</td> | ||
<td> | ||
{# {{ sound.freesound_id | fs_embed | safe }}#} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clear commented code |
||
{% sound_player dataset sound.freesound_id "small" %} | ||
</td> | ||
<td><a href="http://freesound.org/s/{{ sound.freesound_id }}" target="_blank">http://freesound.org/s/{{ sound.freesound_id }}</a></td> | ||
<td>{{ sound.num_PP }}</td> | ||
<td>{{ sound.num_PNP }}</td> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
{% load staticfiles %} | ||
{% load dataset_templatetags %} | ||
{% load general_templatetags %} | ||
{% block extra_head %} | ||
{% load_sound_player_files %} | ||
{% endblock %} | ||
|
||
{% block page_js %} | ||
<script type="text/javascript"> | ||
var popupLoading = '<div style="height:310px; width:730px" class="ui loading segment">Loading</div>'; | ||
|
@@ -12,7 +18,8 @@ | |
var popup = this | ||
var ajax_url = el.getAttribute('ajax_url') | ||
$.ajax({ | ||
url: ajax_url | ||
url: ajax_url, | ||
cache: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this "cache: true" really needed in the end? Anyway, I don't say to remove it. Just want to understand if this would be needed in other cases. |
||
}).done(function(result) { | ||
popup.html(result); | ||
el.setAttribute("data-html", result); | ||
|
@@ -91,7 +98,8 @@ | |
<tr><td>Examples</td> | ||
<td> | ||
{% for fsid in node.freesound_examples %} | ||
{{ fsid| fs_embed | safe }} | ||
{# {{ fsid| fs_embed | safe }}#} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clear |
||
{% sound_player dataset fsid "small" %} | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{% load staticfiles %} | ||
{% load dataset_templatetags %} | ||
{% load general_templatetags %} | ||
|
||
{% block page_js %} | ||
<script type="text/javascript"> | ||
var popupLoading = '<div style="height:310px; width:730px" class="ui loading segment">Loading</div>'; | ||
|
@@ -67,7 +70,8 @@ | |
<tr><td>Examples</td> | ||
<td> | ||
{% for fsid in node.freesound_examples %} | ||
{{ fsid| fs_embed | safe }} | ||
{% sound_player dataset fsid "small" %} | ||
{# {{ fsid| fs_embed | safe }}#} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. clear |
||
{% endfor %} | ||
</td> | ||
</tr> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raising an exception here would make more sense.