• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ossia / score / 30161608849

25 Jul 2026 02:25PM UTC coverage: 15.303% (-0.008%) from 15.311%
30161608849

Pull #2148

github

web-flow
Merge d2b82a62f into 13afd939a
Pull Request #2148: wasm: stream large media from Blob URLs instead of copying into RAM (Tier B)

4 of 179 new or added lines in 10 files covered. (2.23%)

7 existing lines in 5 files now uncovered.

30396 of 198627 relevant lines covered (15.3%)

983.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

9.76
/src/plugins/score-plugin-media/Media/Sound/Drop/SoundDrop.cpp
1
#include "SoundDrop.hpp"
2

3
#include <Process/TimeValueSerialization.hpp>
4

5
#include <Audio/Settings/Model.hpp>
6
#include <Media/AudioDecoder.hpp>
7
#include <Media/Commands/ChangeAudioFile.hpp>
8
#include <Media/Sound/SoundModel.hpp>
9

10
#include <QFileInfo>
11
#include <QMimeData>
12
#include <QUrl>
13

14
namespace Media
15
{
16
namespace Sound
17
{
18
DroppedAudioFiles::DroppedAudioFiles(
×
19
    const score::DocumentContext& ctx, const QMimeData& mime)
20
{
21
  const auto& urls = mime.urls();
×
22
  for(const auto& url : urls)
×
23
  {
24
    QString filename = url.toLocalFile();
×
25
#if defined(__EMSCRIPTEN__)
26
    if(filename.isEmpty() && url.scheme() == QLatin1String("weblocalfile"))
27
      filename = url.toString();
28
#endif
NEW
29
    if(!(AudioFile::isSupported(QFile{filename})
×
30
      || AudioFile::isSupportedVideo(QFile{filename})))
×
31
      continue;
×
32

33
    if(auto info_opt = probe(filename))
×
34
    {
35
      auto info = *info_opt;
×
36
      if(info.channels > 0 && info.fileLength > 0)
×
37
      {
38
        auto dur = info.duration();
×
39
        files.emplace_back(std::make_pair(filename, dur));
×
40
        maxDuration = std::max(maxDuration, dur);
×
41
      }
×
42
    }
×
43
  }
×
44
}
×
45

46
TimeVal DroppedAudioFiles::dropMaxDuration() const
×
47
{
48
  return maxDuration;
×
49
}
50

51
QSet<QString> DropHandler::mimeTypes() const noexcept
36✔
52
{
53
  return {}; // TODO
36✔
54
}
55

56
QSet<QString> DropHandler::fileExtensions() const noexcept
47✔
57
{
58
  return {"wav", "mp3", "m4a", "ogg", "flac", "aif", "aiff", "w64", "ape", "wv", "wma", "aac", "opus", "ac3", "dts", "dtshd"};
47✔
59
}
60

61
void DropHandler::dropCustom(
×
62
    std::vector<ProcessDrop>& vec, const QMimeData& mime,
63
    const score::DocumentContext& ctx) const noexcept
64
{
65
  DroppedAudioFiles drop{ctx, mime};
×
66
  if(!drop.valid())
×
67
    return;
×
68

69
  for(auto&& file : drop.files)
×
70
  {
71
    Process::ProcessDropHandler::ProcessDrop p;
×
72
    p.creation.key = Metadata<ConcreteKey_k, Sound::ProcessModel>::get();
×
73
    p.creation.prettyName = QFileInfo{file.first}.baseName();
×
74
    p.duration = file.second;
×
75
    p.setup = [f = score::relativizeFilePath(file.first, ctx), song_t = *p.duration,
×
76
               &ctx](Process::ProcessModel& m, score::Dispatcher& disp) {
×
77
      auto& proc = static_cast<Sound::ProcessModel&>(m);
×
78
      disp.submit(new Media::ChangeAudioFile{proc, std::move(f), ctx});
×
79
    };
×
80
    vec.push_back(std::move(p));
×
81
  }
×
82

83
  return;
×
84
}
×
85

86
}
87
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc