Revision 45:0033259c6772 common/Objects.cpp
| common/Objects.cpp | ||
|---|---|---|
| 825 | 825 |
} |
| 826 | 826 |
} |
| 827 | 827 |
|
| 828 |
TrackFile::TrackFile(QObject *parent) : |
|
| 829 |
QObject(parent), |
|
| 830 |
m_composer(0), |
|
| 831 |
m_work(0), |
|
| 832 |
m_movement(0) |
|
| 828 |
AudioFile::AudioFile(QObject *parent) : |
|
| 829 |
QObject(parent) |
|
| 833 | 830 |
{
|
| 834 | 831 |
} |
| 835 | 832 |
|
| 836 |
TrackFile::TrackFile(FileSource source, QObject *parent) : |
|
| 837 |
QObject(parent), |
|
| 838 |
m_composer(0), |
|
| 839 |
m_work(0), |
|
| 840 |
m_movement(0) |
|
| 833 |
AudioFile::AudioFile(FileSource source, QObject *parent) : |
|
| 834 |
QObject(parent) |
|
| 841 | 835 |
{
|
| 842 | 836 |
if (source.isAvailable()) {
|
| 843 | 837 |
QFile f(source.getLocalFilename()); |
| 844 | 838 |
f.open(QIODevice::ReadOnly); |
| 845 |
//!!! data may be too large!
|
|
| 839 |
//!!! stream this!
|
|
| 846 | 840 |
QByteArray ba = f.readAll(); |
| 847 | 841 |
m_hash = QString::fromAscii |
| 848 | 842 |
(QCryptographicHash::hash(ba, QCryptographicHash::Sha1).toHex()); |
| ... | ... | |
| 859 | 853 |
m_uri = Dataquay::Uri("file://" + QFileInfo(location).canonicalFilePath());
|
| 860 | 854 |
} |
| 861 | 855 |
} |
| 862 |
std::cerr << "TrackFile::TrackFile: hash = " << m_hash.toStdString() |
|
| 856 |
|
|
| 857 |
std::cerr << "AudioFile::AudioFile: hash = " << m_hash.toStdString() |
|
| 863 | 858 |
<< ", uri = " << m_uri.toString().toStdString() << std::endl; |
| 864 | 859 |
} |
| 865 | 860 |
|
Also available in: Unified diff